Re: [PATCH] x86/dumpstack/64: Add guard pages to stack_info

From
Peter Zijlstra <peterz@infradead.org>
Date
2021-09-16 08:04:05
Also in
bpf, lkml, netdev
Reply to
Peter Zijlstra, 2021-09-16
On Thu, Sep 16, 2021 at 10:00:15AM +0200, Peter Zijlstra wrote:
On Thu, Sep 16, 2021 at 11:47:49AM +0800, 王贇 wrote:
quoted
I did some debug and found the issue, we are missing:
@@ -122,7 +137,10 @@ static __always_inline bool in_exception_stack(unsigned long *stack, struct stac
        info->type      = ep->type;
        info->begin     = (unsigned long *)begin;
        info->end       = (unsigned long *)end;
-       info->next_sp   = (unsigned long *)regs->sp;
+
+       if (!(ep->type & STACK_TYPE_GUARD))
+               info->next_sp   = (unsigned long *)regs->sp;
+
        return true;
 }
as the guard page are not working as real stack I guess?
Correct, but I thought I put if (type & GUARD) terminators in all paths
that ended up caring about ->next_sp. Clearly I seem to have missed one
:/

Let me try and figure out where that happens.
Oh, I'm an idiot... yes it tries to read regs the stack, but clearly
that won't work for the guard page.
Thread (24 messages) 24 messages, 2 authors, last reply 2021-09-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help