{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "d809a7c64ba8229286b333c0cba03b1cdfb50238"
            },
            {
              "fixed": "3527e9fdc38570cea0f6ddb7a2c9303d4044b217"
            },
            {
              "fixed": "652cd0641a763dd0e846b0d12814977fadb2b7d8"
            },
            {
              "fixed": "6557004a8b59c7701e695f02be03c7e20ed1cc15"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "6.17.0"
            },
            {
              "fixed": "6.18.21"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "6.19.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31457.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/sysfs: check contexts-\u003enr in repeat_call_fn\n\ndamon_sysfs_repeat_call_fn() calls damon_sysfs_upd_tuned_intervals(),\ndamon_sysfs_upd_schemes_stats(), and\ndamon_sysfs_upd_schemes_effective_quotas() without checking contexts-\u003enr. \nIf nr_contexts is set to 0 via sysfs while DAMON is running, these\nfunctions dereference contexts_arr[0] and cause a NULL pointer\ndereference.  Add the missing check.\n\nFor example, the issue can be reproduced using DAMON sysfs interface and\nDAMON user-space tool (damo) [1] like below.\n\n    $ sudo damo start --refresh_interval 1s\n    $ echo 0 | sudo tee \\\n            /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts",
  "id": "CVE-2026-31457",
  "modified": "2026-07-15T01:48:55.012836253Z",
  "published": "2026-04-22T13:53:50.220Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/3527e9fdc38570cea0f6ddb7a2c9303d4044b217"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/652cd0641a763dd0e846b0d12814977fadb2b7d8"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/6557004a8b59c7701e695f02be03c7e20ed1cc15"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31457.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31457"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.8.0",
  "summary": "mm/damon/sysfs: check contexts-\u003enr in repeat_call_fn"
}