Thread (37 messages) 37 messages, 3 authors, 2021-09-18

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

flat view

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-09-16 08:04:05
Also in: bpf, linux-perf-users, lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help