{"id":"CVE-2025-40358","state":"PUBLISHED","title":"riscv: stacktrace: Disable KASAN checks for non-current tasks","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: stacktrace: Disable KASAN checks for non-current tasks\n\nUnwinding the stack of a task other than current, KASAN would report\n\"BUG: KASAN: out-of-bounds in walk_stackframe+0x41c/0x460\"\n\nThere is a same issue on x86 and has been resolved by the commit\n84936118bdf3 (\"x86/unwind: Disable KASAN checks for non-current tasks\")\nThe solution could be applied to RISC-V too.\n\nThis patch also can solve the issue:\nhttps://seclists.org/oss-sec/2025/q4/23\n\n[pjw@kernel.org: clean up checkpatch issues]","publishedAt":"2025-12-16T13:39:57.847Z","updatedAt":"2026-08-05T12:09:53.455Z","severity":{"score":7.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"f34ba22989da61186f30a40b6a82e0b3337b96fc","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"2c8d2b53866fb229b438296526ef0fa5a990e5e5","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"060ea84a484e852b52b938f234bf9b5503a6c910","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kernel/stacktrace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.15","versionType":"semver"},{"version":"6.1.167","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.117","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.58","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.8","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kernel/stacktrace.c"]}],"references":["https://git.kernel.org/stable/c/ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f","https://git.kernel.org/stable/c/f34ba22989da61186f30a40b6a82e0b3337b96fc","https://git.kernel.org/stable/c/27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2","https://git.kernel.org/stable/c/2c8d2b53866fb229b438296526ef0fa5a990e5e5","https://git.kernel.org/stable/c/060ea84a484e852b52b938f234bf9b5503a6c910"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40358.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40358","state":"PUBLISHED","datePublished":"2025-12-16T13:39:57.847Z","dateUpdated":"2026-08-05T12:09:53.455Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.187Z"},"containers":{"cna":{"title":"riscv: stacktrace: Disable KASAN checks for non-current tasks","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: stacktrace: Disable KASAN checks for non-current tasks\n\nUnwinding the stack of a task other than current, KASAN would report\n\"BUG: KASAN: out-of-bounds in walk_stackframe+0x41c/0x460\"\n\nThere is a same issue on x86 and has been resolved by the commit\n84936118bdf3 (\"x86/unwind: Disable KASAN checks for non-current tasks\")\nThe solution could be applied to RISC-V too.\n\nThis patch also can solve the issue:\nhttps://seclists.org/oss-sec/2025/q4/23\n\n[pjw@kernel.org: clean up checkpatch issues]"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"f34ba22989da61186f30a40b6a82e0b3337b96fc","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"2c8d2b53866fb229b438296526ef0fa5a990e5e5","versionType":"git"},{"version":"5d8544e2d0075a5f3c9a2cf27152354d54360da1","status":"affected","lessThan":"060ea84a484e852b52b938f234bf9b5503a6c910","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kernel/stacktrace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.15","versionType":"semver"},{"version":"6.1.167","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.117","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.58","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.8","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kernel/stacktrace.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f"},{"url":"https://git.kernel.org/stable/c/f34ba22989da61186f30a40b6a82e0b3337b96fc"},{"url":"https://git.kernel.org/stable/c/27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2"},{"url":"https://git.kernel.org/stable/c/2c8d2b53866fb229b438296526ef0fa5a990e5e5"},{"url":"https://git.kernel.org/stable/c/060ea84a484e852b52b938f234bf9b5503a6c910"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The unwinder is reached through local interfaces only — reading /proc/PID/stack, or by inducing a hung-task/OOM-reaper/workqueue-stall stack dump from a local process. No network-facing code path reaches walk_stackframe on a non-current task.\nAC:L - The attacker controls both sides of the race: one thread spins in the kernel while a sibling thread reads the stack of the still-running task, which is exactly what the published syzkaller reproducer does. No memory layout or timing condition outside the attacker's influence is needed.\nPR:L - The demonstrated /proc/PID/stack path requires CAP_SYS_ADMIN in the initial user namespace, but the same non-current unwind is reached without privileges via default-enabled paths that dump a concurrently running task — hung_task's debug_show_blocker() on a running mutex owner, the OOM reaper failure dump, and the workqueue stall watchdog. An ordinary local account suffices for those.\nUI:N - The attacker triggers the stack walk entirely from its own threads; no action by another user or administrator is required.\nS:U - The faulty read and its consequences are confined to the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The unwinder performs an out-of-bounds read of another task's live kernel stack, following an attacker-influenced frame chain to essentially arbitrary offsets within that stack, and the resulting KASAN splat plus /proc/PID/stack output disclose raw kernel stack and text addresses, defeating KASLR.\nI:N - walk_stackframe only loads values from the stack and reports them through a bounded consumer callback; there is no write of any kind, so no kernel state can be modified.\nA:H - The KASAN report goes through check_panic_on_warn(\"KASAN\") and honors kasan.fault=panic, so a repeatable attacker-triggered splat becomes a kernel panic on such configurations, and unbounded report flooding degrades the system otherwise."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:09:53.455Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.1.167"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.6.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.12.58"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.17.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}