CVE-2025-40358 riscv: stacktrace: Disable KASAN checks for non-current tasks
A kernel bug causes false-positive KASAN out-of-bounds reports when unwinding non-current task stacks, potentially leading to system crashes or instability.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-40358?
CVE-2025-40358 is a high-severity denial of service vulnerability in Linux, published on 16 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
riscv: stacktrace: Disable KASAN checks for non-current tasks
Unwinding the stack of a task other than current, KASAN would report "BUG: KASAN: out-of-bounds in walk_stackframe+0x41c/0x460"
There is a same issue on x86 and has been resolved by the commit 84936118bdf3 ("x86/unwind: Disable KASAN checks for non-current tasks") The solution could be applied to RISC-V too.
This patch also can solve the issue: https://seclists.org/oss-sec/2025/q4/23
[[email protected]: clean up checkpatch issues]
Which versions are affected by CVE-2025-40358?
How do I fix CVE-2025-40358?
Apply the vendor's patch.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-40358 being exploited?
There is no known exploitation of CVE-2025-40358 in the wild and no public exploit code.
Sources
Also known as BELL-CVE-2025-40358, DEBIAN-CVE-2025-40358, GHSA-qchg-c772-c4pf, ROOT-OS-DEBIAN-11-CVE-2025-40358, ROOT-OS-DEBIAN-12-CVE-2025-40358, ROOT-OS-DEBIAN-13-CVE-2025-40358 and 3 more.