{"id":"CVE-2026-31458","title":"mm/damon/sysfs: check contexts->nr before accessing contexts_arr[0]","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/sysfs: check contexts->nr before accessing contexts_arr[0]\n\nMultiple sysfs command paths dereference contexts_arr[0] without first\nverifying that kdamond->cont…","severity":"none","vendor":"Linux","product":"Linux","affected":["Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < aba546061341b56e9ffb37e1eb661a3628b6ec12","Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 1e8da792672481d603fa7cd0d815577220a3ee27","Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 708033c231bd782858f4ddbb46ee874a5a5fbdab","Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < bbe03ad3fb9e714191757ca7b41582f930be7be2","Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 1bfe9fb5ed2667fb075682408b776b5273162615","Linux 5.18"],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-11-05T21:34:11.121096Z"},"published":"2026-04-22","updated":"2026-11-05","sourceUpdated":"2026-11-05T21:44:59.942Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-31458","references":[{"url":"https://git.kernel.org/stable/c/aba546061341b56e9ffb37e1eb661a3628b6ec12"},{"url":"https://git.kernel.org/stable/c/1e8da792672481d603fa7cd0d815577220a3ee27"},{"url":"https://git.kernel.org/stable/c/708033c231bd782858f4ddbb46ee874a5a5fbdab"},{"url":"https://git.kernel.org/stable/c/bbe03ad3fb9e714191757ca7b41582f930be7be2"},{"url":"https://git.kernel.org/stable/c/1bfe9fb5ed2667fb075682408b776b5273162615"}],"tags":["cve.org"],"epss":0.00122,"epssPercentile":0.01983,"ingestedAt":"2026-11-05T22:38:32.148Z","slug":"CVE-2026-31458","body":"## Overview\n\nIn the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/sysfs: check contexts->nr before accessing contexts_arr[0]\n\nMultiple sysfs command paths dereference contexts_arr[0] without first\nverifying that kdamond->contexts->nr == 1.  A user can set nr_contexts to\n0 via sysfs while DAMON is running, causing NULL pointer dereferences.\n\nIn more detail, the issue can be triggered by privileged users like\nbelow.\n\nFirst, start DAMON and make contexts directory empty\n(kdamond->contexts->nr == 0).\n\n    # damo start\n    # cd /sys/kernel/mm/damon/admin/kdamonds/0\n    # echo 0 > contexts/nr_contexts\n\nThen, each of below commands will cause the NULL pointer dereference.\n\n    # echo update_schemes_stats > state\n    # echo update_schemes_tried_regions > state\n    # echo update_schemes_tried_bytes > state\n    # echo update_schemes_effective_quotas > state\n    # echo update_tuned_intervals > state\n\nGuard all commands (except OFF) at the entry point of\ndamon_sysfs_handle_cmd().\n\n## Affected\n\n- `Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < aba546061341b56e9ffb37e1eb661a3628b6ec12`\n- `Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 1e8da792672481d603fa7cd0d815577220a3ee27`\n- `Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 708033c231bd782858f4ddbb46ee874a5a5fbdab`\n- `Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < bbe03ad3fb9e714191757ca7b41582f930be7be2`\n- `Linux >= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 < 1bfe9fb5ed2667fb075682408b776b5273162615`\n- `Linux 5.18`\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}