• Andy Lutomirski's avatar
    x86/irq/64: Remap the IRQ stack with guard pages · 18b7a6be
    Andy Lutomirski authored
    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.
    
    [ tglx: Move the map code to a proper place and invoke it only when a CPU
      	is about to be brought online. No point in installing the map at
      	early boot for all possible CPUs. Fail the CPU bringup if the vmap()
      	fails as done for all other preparatory stages in CPU hotplug. ]
    Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: Nicolai Stange <nstange@suse.de>
    Cc: Sean Christopherson <sean.j.christopherson@intel.com>
    Cc: x86-ml <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20190414160146.363733568@linutronix.de
    18b7a6be
irq_64.c 3.52 KB