{"id":"CVE-2026-31458","published":"2026-04-22T13:53:50Z","modified":"2026-11-05T21:44:59Z","title":"mm/damon/sysfs: check contexts->nr before accessing contexts_arr[0]","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"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->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().","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.00168,"percentile":0.03485,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/aba546061341b56e9ffb37e1eb661a3628b6ec12","tags":[]},{"url":"https://git.kernel.org/stable/c/1e8da792672481d603fa7cd0d815577220a3ee27","tags":[]},{"url":"https://git.kernel.org/stable/c/708033c231bd782858f4ddbb46ee874a5a5fbdab","tags":[]},{"url":"https://git.kernel.org/stable/c/bbe03ad3fb9e714191757ca7b41582f930be7be2","tags":[]},{"url":"https://git.kernel.org/stable/c/1bfe9fb5ed2667fb075682408b776b5273162615","tags":[]}],"priority":{"score":0.7,"factors":[{"name":"EPSS percentile","points":0.7}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7, < aba546061341b56e9ffb37e1eb661a3628b6ec12",">= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7, < 1e8da792672481d603fa7cd0d815577220a3ee27",">= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7, < 708033c231bd782858f4ddbb46ee874a5a5fbdab",">= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7, < bbe03ad3fb9e714191757ca7b41582f930be7be2",">= 0ac32b8affb5a384253dbb8339bd2d0e91add0b7, < 1bfe9fb5ed2667fb075682408b776b5273162615"]},{"vendor":"Linux","product":"Linux","versions":["5.18"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-11-05T21:34:11.121096Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-24797","exploited":false,"provenance":"source"}}