]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
riscv: stacktrace: Disable KASAN checks for non-current tasks
authorChunyan Zhang <zhangchunyan@iscas.ac.cn>
Mon, 27 Oct 2025 17:40:43 +0000 (11:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:41 +0000 (15:37 -0500)
commit2c8d2b53866fb229b438296526ef0fa5a990e5e5
tree11874d126bb7c59bfd1035eca03bd7311ea794c1
parent34c845d0f907ede9e4082b268ec83f2c2403d286
riscv: stacktrace: Disable KASAN checks for non-current tasks

[ Upstream commit 060ea84a484e852b52b938f234bf9b5503a6c910 ]

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

Fixes: 5d8544e2d007 ("RISC-V: Generic library routines and assembly")
Co-developed-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Signed-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Link: https://lore.kernel.org/r/20251022072608.743484-1-zhangchunyan@iscas.ac.cn
[pjw@kernel.org: clean up checkpatch issues]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/stacktrace.c