lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 7 Apr 2019 19:23:34 -0700
From:   Andy Lutomirski <luto@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Andy Lutomirski <luto@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [patch V2 28/29] x86/irq/64: Remap the IRQ stack with guard pages

On Sun, Apr 7, 2019 at 3:44 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Sat, 6 Apr 2019, Andy Lutomirski wrote:
> > On Fri, Apr 5, 2019 at 8:11 AM Thomas Gleixner <tglx@...utronix.de> wrote:
> > >
> > > From: Andy Lutomirski <luto@...nel.org>
> > >
> > > The IRQ stack lives in percpu space, so an IRQ handler that overflows it
> > > will overwrite other data structures.
> > >
> > > Use vmap() to remap the IRQ stack so that it will have the usual guard
> > > pages that vmap/vmalloc allocations have. With this the kernel will panic
> > > immediately on an IRQ stack overflow.
> >
> > The 0day bot noticed that this dies with DEBUG_PAGEALLOC on.  This is
> > because the store_stackinfo() function is utter garbage and this patch
> > correctly detects just how broken it is.  The attached patch "fixes"
> > it.  (It also contains a reliability improvement that should probably
> > get folded in, but is otherwise unrelated.)
> >
> > A real fix would remove the generic kstack_end() function entirely
> > along with __HAVE_ARCH_KSTACK_END and would optionally replace
> > store_stackinfo() with something useful.  Josh, do we have a generic
> > API to do a little stack walk like this?  Otherwise, I don't think it
> > would be the end of the world to just remove the offending code.
>
> 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

(Link is bad right now but will hopefully be okay when you read it.
I'm still fiddling with the other patches in there -- I'd like to kill
kstack_end() entirely.

Powered by blists - more mailing lists