mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 11:46:54 +07:00
f56141e3e2
If an attacker can cause a controlled kernel stack overflow, overwriting the restart block is a very juicy exploit target. This is because the restart_block is held in the same memory allocation as the kernel stack. Moving the restart block to struct task_struct prevents this exploit by making the restart_block harder to locate. Note that there are other fields in thread_info that are also easy targets, at least on some architectures. It's also a decent simplification, since the restart code is more or less identical on all architectures. [james.hogan@imgtec.com: metag: align thread_info::supervisor_stack] Signed-off-by: Andy Lutomirski <luto@amacapital.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Kees Cook <keescook@chromium.org> Cc: David Miller <davem@davemloft.net> Acked-by: Richard Weinberger <richard@nod.at> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Steven Miao <realmz6@gmail.com> Cc: Mark Salter <msalter@redhat.com> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Chen Liqin <liqin.linux@gmail.com> Cc: Lennox Wu <lennox.wu@gmail.com> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Chris Zankel <chris@zankel.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
adc.h | ||
addrspace.h | ||
alignment.h | ||
asm-offsets.h | ||
atomic-grb.h | ||
atomic-irq.h | ||
atomic-llsc.h | ||
atomic.h | ||
barrier.h | ||
bitops-grb.h | ||
bitops-llsc.h | ||
bitops-op32.h | ||
bitops.h | ||
bl_bit_32.h | ||
bl_bit_64.h | ||
bl_bit.h | ||
bug.h | ||
bugs.h | ||
cache_insns_32.h | ||
cache_insns_64.h | ||
cache_insns.h | ||
cache.h | ||
cacheflush.h | ||
checksum_32.h | ||
checksum.h | ||
clkdev.h | ||
clock.h | ||
cmpxchg-grb.h | ||
cmpxchg-irq.h | ||
cmpxchg-llsc.h | ||
cmpxchg.h | ||
device.h | ||
dma-mapping.h | ||
dma-register.h | ||
dma.h | ||
dmabrg.h | ||
dwarf.h | ||
elf.h | ||
entry-macros.S | ||
fb.h | ||
fixmap.h | ||
flat.h | ||
fpu.h | ||
freq.h | ||
ftrace.h | ||
futex-irq.h | ||
futex.h | ||
gpio.h | ||
hardirq.h | ||
hd64461.h | ||
heartbeat.h | ||
hugetlb.h | ||
hw_breakpoint.h | ||
hw_irq.h | ||
i2c-sh7760.h | ||
io_generic.h | ||
io_noioport.h | ||
io_trapped.h | ||
io.h | ||
irq.h | ||
irqflags.h | ||
Kbuild | ||
kdebug.h | ||
kexec.h | ||
kgdb.h | ||
kmap_types.h | ||
kprobes.h | ||
linkage.h | ||
machvec.h | ||
mc146818rtc.h | ||
mmu_context_32.h | ||
mmu_context_64.h | ||
mmu_context.h | ||
mmu.h | ||
mmzone.h | ||
module.h | ||
mutex-llsc.h | ||
mutex.h | ||
page.h | ||
pci.h | ||
perf_event.h | ||
pgalloc.h | ||
pgtable_32.h | ||
pgtable_64.h | ||
pgtable-2level.h | ||
pgtable-3level.h | ||
pgtable.h | ||
posix_types.h | ||
processor_32.h | ||
processor_64.h | ||
processor.h | ||
ptrace_32.h | ||
ptrace_64.h | ||
ptrace.h | ||
push-switch.h | ||
reboot.h | ||
romimage-macros.h | ||
rtc.h | ||
rwsem.h | ||
seccomp.h | ||
sections.h | ||
segment.h | ||
setup.h | ||
sfp-machine.h | ||
sh7760fb.h | ||
sh_bios.h | ||
shmparam.h | ||
siu.h | ||
smc37c93x.h | ||
smp-ops.h | ||
smp.h | ||
sparsemem.h | ||
spi.h | ||
spinlock_types.h | ||
spinlock.h | ||
sram.h | ||
stackprotector.h | ||
stacktrace.h | ||
string_32.h | ||
string_64.h | ||
string.h | ||
suspend.h | ||
switch_to_32.h | ||
switch_to_64.h | ||
switch_to.h | ||
syscall_32.h | ||
syscall_64.h | ||
syscall.h | ||
syscalls_32.h | ||
syscalls_64.h | ||
syscalls.h | ||
thread_info.h | ||
timex.h | ||
tlb_64.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
traps_32.h | ||
traps_64.h | ||
traps.h | ||
types.h | ||
uaccess_32.h | ||
uaccess_64.h | ||
uaccess.h | ||
unaligned-sh4a.h | ||
unaligned.h | ||
uncached.h | ||
unistd.h | ||
unwinder.h | ||
user.h | ||
vga.h | ||
vmlinux.lds.h | ||
watchdog.h | ||
word-at-a-time.h |