Re: [patch V2 28/29] x86/irq/64: Remap the IRQ stack with guard pages

From: Thomas Gleixner
Date: Mon Apr 08 2019 - 02:46:19 EST


On Sun, 7 Apr 2019, Andy Lutomirski wrote:
> On Sun, Apr 7, 2019 at 3:44 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > Actually we have: save_stack_trace()
> >
>
> Like I did here:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/log/?h=WIP.x86/stackguards

Kinda, but what that code wants is to skip any entry before 'caller'. So we
either add something like save_stack_trace_from() which is trivial on x86
because unwind_start() already has an argument to hand in the start of
stack or we filter out the entries up to 'caller' in that code.

Btw, your patch will explode badly because stack_trace::entries is just a
pointer. It does not provide a storage array :)

Thanks,

tglx