linux/arch/xtensa/kernel
Andy Lutomirski f56141e3e2 all arches, signal: move restart_block to struct task_struct
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>
2015-02-12 18:54:12 -08:00
..
.gitignore xtensa: tell git to ignore generated files 2013-06-05 10:14:19 -07:00
Makefile xtensa: add SMP support 2014-01-14 10:19:58 -08:00
align.S xtensa: allow single-stepping through unaligned load/store 2014-08-14 11:59:30 +04:00
asm-offsets.c
coprocessor.S xtensa: keep a3 and excsave1 on entry to exception handlers 2013-09-06 09:47:41 -07:00
entry.S xtensa: deprecate fast_xtensa and fast_spill_registers syscalls 2014-08-14 11:59:33 +04:00
head.S xtensa: move vecbase SR initialization to _startup 2014-10-21 13:28:55 +04:00
irq.c xtensa: Use irq_set_affinity instead of homebrewn code 2014-03-04 17:37:55 +01:00
mcount.S xtensa: add static function tracer support 2013-07-08 01:18:57 -07:00
module.c
mxhead.S xtensa: add SMP support 2014-01-14 10:19:58 -08:00
pci-dma.c xtensa: fix address checks in dma_{alloc,free}_coherent 2014-08-14 11:59:14 +04:00
pci.c xtensa: fix section mismatch in pcibios_fixup_bus 2013-06-05 10:14:22 -07:00
platform.c xtensa: cleanup ccount frequency tracking 2013-07-08 01:11:37 -07:00
process.c xtensa: Use generic idle loop 2013-04-08 17:39:29 +02:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
setup.c Merge branch 'dt-bus-name' into for-next 2014-05-13 18:34:35 -05:00
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c flush_icache_range: export symbol to fix build errors 2014-08-29 16:28:17 -07:00
stacktrace.c xtensa: provide custom CALLER_ADDR* implementations 2013-05-09 01:07:10 -07:00
syscall.c xtensa: nommu: don't provide arch_get_unmapped_area 2014-10-21 13:28:48 +04:00
time.c xtensa: export ccount_freq 2014-01-19 20:00:48 +04:00
traps.c xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
vectors.S xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
vmlinux.lds.S xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
xtensa_ksyms.c xtensa: export __{invalidate,flush}_dcache_range 2014-04-02 01:35:50 +04:00