Re: [PATCH 2/2] x86/dumpstack: Fix broken unwinding from exception stacks

From: Jann Horn
Date: Mon Mar 24 2025 - 22:25:03 EST


On Tue, Mar 25, 2025 at 3:01 AM Jann Horn <jannh@xxxxxxxxxx> wrote:
> Originally, get_stack_pointer() used the regs provided by the caller; after
> that commit, get_stack_pointer() instead uses the regs at the top of the
> stack frame the unwinder is looking at. Often, there are no such regs at
> all, and "regs" is NULL, causing get_stack_pointer() to fall back to the
> task's current stack pointer, which is not what we want here, but probably
> happens to mostly work. Other times, the original regs will point to
> another regs frame - in that case, the linear guess unwind logic in
> show_trace_log_lvl() will start unwinding too far up the stack, causing the
> first frame found by the proper unwinder to never be visited, resulting in
> a stack trace consisting purely of guess lines.

I guess the subject line is kind of misleading - maybe "x86/dumpstack:
Fix misplaced assignment in unwinder" would be better?