Skip to contentSkip to conversation

CVE-2025-40358: riscv: stacktrace: Disable KASAN checks for non-current tasks

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 16, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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]

The Linux kernel CVE team has assigned CVE-2025-40358 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.15 with commit 5d8544e2d0075a5f3c9a2cf27152354d54360da1 and fixed in 6.6.117 with commit f34ba22989da61186f30a40b6a82e0b3337b96fc
	Issue introduced in 4.15 with commit 5d8544e2d0075a5f3c9a2cf27152354d54360da1 and fixed in 6.12.58 with commit 27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2
	Issue introduced in 4.15 with commit 5d8544e2d0075a5f3c9a2cf27152354d54360da1 and fixed in 6.17.8 with commit 2c8d2b53866fb229b438296526ef0fa5a990e5e5
	Issue introduced in 4.15 with commit 5d8544e2d0075a5f3c9a2cf27152354d54360da1 and fixed in 6.18 with commit 060ea84a484e852b52b938f234bf9b5503a6c910

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2025-40358

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
arch/riscv/kernel/stacktrace.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	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