{"id":"CVE-2026-31458","aliases":["CVE-2026-31458"],"related":[],"kind":"vulnerability","state":"published","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->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().","summarySource":"cvelist","descriptions":[{"lang":"en","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().","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/damon/sysfs: verificar contexts  ->  nr antes de acceder a contexts_arr[0]\n\nMúltiples rutas de comandos sysfs desreferencian contexts_arr[0] sin verificar primero que kdamond  ->  contexts  ->  nr == 1. Un usuario puede establecer nr_contexts en 0 a través de sysfs mientras DAMON está en ejecución, causando desreferencias de puntero NULL.\n\nEn más detalle, el problema puede ser activado por usuarios privilegiados como se muestra a continuación.\n\nPrimero, inicie DAMON y deje el directorio contexts vacío (kdamond  ->  contexts  ->  nr == 0).\n\n    # damo start\n    # cd /sys/kernel/mm/damon/admin/kdamonds/0\n    # echo 0 > contexts/nr_contexts\n\nLuego, cada uno de los siguientes comandos causará la desreferencia del puntero NULL.\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\nProteja todos los comandos (excepto OFF) en el punto de entrada de damon_sysfs_handle_cmd().","source":"nvd"}],"published":"2026-04-22T13:53:50.883Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"0ac32b8affb5a384253dbb8339bd2d0e91add0b7","fixed":"aba546061341b56e9ffb37e1eb661a3628b6ec12","status":"affected"},{"type":"git","introduced":"0ac32b8affb5a384253dbb8339bd2d0e91add0b7","fixed":"1e8da792672481d603fa7cd0d815577220a3ee27","status":"affected"},{"type":"git","introduced":"0ac32b8affb5a384253dbb8339bd2d0e91add0b7","fixed":"708033c231bd782858f4ddbb46ee874a5a5fbdab","status":"affected"},{"type":"git","introduced":"0ac32b8affb5a384253dbb8339bd2d0e91add0b7","fixed":"bbe03ad3fb9e714191757ca7b41582f930be7be2","status":"affected"},{"type":"git","introduced":"0ac32b8affb5a384253dbb8339bd2d0e91add0b7","fixed":"1bfe9fb5ed2667fb075682408b776b5273162615","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"6.6.131","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.80","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.21","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.11","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.18","fixed":"6.6.131"},{"status":"affected","introduced":"6.7","fixed":"6.12.80"},{"status":"affected","introduced":"6.13","fixed":"6.18.21"},{"status":"affected","introduced":"6.19","fixed":"6.19.11"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/aba546061341b56e9ffb37e1eb661a3628b6ec12","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1e8da792672481d603fa7cd0d815577220a3ee27","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/708033c231bd782858f4ddbb46ee874a5a5fbdab","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bbe03ad3fb9e714191757ca7b41582f930be7be2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1bfe9fb5ed2667fb075682408b776b5273162615","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:34:11.121Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31458","url":"https://www.cve.org/CVERecord?id=CVE-2026-31458","licence":"CVE Terms of Use","modified":"2026-11-05T21:44:59.942Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31458","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31458","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.272Z","epss":{"score":0.00127,"percentile":0.02578,"date":"2026-12-01T12:00:22.000Z"}}