[PW_SID:1096084] [v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()#1956
[PW_SID:1096084] [v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()#1956linux-riscv-bot wants to merge 2 commits into
Conversation
The fp_is_valid() function uses ALIGN(sp, THREAD_SIZE) as the upper bound for the frame pointer check. This bound is calculated relative to the current sp and shifts upward when sp itself exceeds the valid stack region, allowing the unwinder to read past the end of the allocated task stack and triggering KASAN stack-out-of-bounds. Fix this by using the absolute task stack boundary (task_pt_regs(task)) instead. This ensures that once the frame pointer walks past the actual end of the stack, the check consistently fails and the unwinding terminates. Fixes: a2a4d4a ("riscv: stacktrace: fixed walk_stackframe()") Signed-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn> Assisted-by: OpenClaw:DeepSeek-V3.2 Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
|
Patch 1: "[v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()" |
a1231b7 to
c03cdce
Compare
PR for series 1096084 applied to workflow__riscv__fixes
Name: [v2] riscv: stacktrace: fix stack-out-of-bounds in walk_stackframe()
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1096084
Version: 2