linux/arch/s390/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
..
vdso32 s390/vdso: fix stack corruption 2014-10-27 13:27:02 +01:00
vdso64 s390/vdso: fix stack corruption 2014-10-27 13:27:02 +01:00
.gitignore
asm-offsets.c s390/cmpxchg: use compiler builtins 2014-11-03 13:29:47 +01:00
audit.c
audit.h
base.S s390: add SMT support 2015-01-22 12:16:01 +01:00
cache.c s390/cacheinfo: don't use smp_processor_id() in preemptible context 2015-02-10 10:15:57 +01:00
compat_audit.c
compat_linux.c groups: Consolidate the setgroups permission checks 2014-12-05 17:19:27 -06:00
compat_linux.h s390: add support for vector extension 2014-10-09 09:14:13 +02:00
compat_ptrace.h
compat_signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
compat_wrapper.c s390/kernel: add system calls for PCI memory access 2014-11-19 09:46:43 +01:00
cpcmd.c
crash_dump.c s390/kdump: add support for vector extension 2014-10-09 09:14:16 +02:00
debug.c s390/debug: avoid function call for debug_sprintf_* 2014-12-08 09:42:29 +01:00
diag.c
dis.c s390: add SMT support 2015-01-22 12:16:01 +01:00
dumpstack.c s390/traps: print interrupt code and instruction length code 2014-11-21 08:49:30 +01:00
early.c s390/spinlock: add compare-and-delay to lock wait loops 2015-01-23 15:17:04 +01:00
ebcdic.c
entry.h s390/signal: add sys_sigreturn and sys_rt_sigreturn declarations 2015-01-08 10:02:49 +01:00
entry.S s390: use local symbol names in entry[64].S 2014-12-08 09:42:38 +01:00
entry64.S s390: use local symbol names in entry[64].S 2014-12-08 09:42:38 +01:00
ftrace.c s390/ftrace: hotpatch support for function tracing 2015-01-29 09:19:25 +01:00
head.S s390: add z13 code generation support 2015-01-22 12:15:57 +01:00
head31.S
head64.S
head_kdump.S
idle.c s390/idle: convert open coded idle time seqcount 2014-12-08 09:42:32 +01:00
ipl.c s390: add SMT support 2015-01-22 12:16:01 +01:00
irq.c s390/irq: use irq 0 2014-11-18 18:23:03 +01:00
jump_label.c s390/jump label: use different nop instruction 2015-01-29 16:33:34 +01:00
kprobes.c s390/ftrace: hotpatch support for function tracing 2015-01-29 09:19:25 +01:00
lgr.c
machine_kexec.c s390: add SMT support 2015-01-22 12:16:01 +01:00
Makefile s390/ftrace: hotpatch support for function tracing 2015-01-29 09:19:25 +01:00
mcount.S s390/ftrace: hotpatch support for function tracing 2015-01-29 09:19:25 +01:00
module.c module_arch_freeing_init(): new hook for archs before module->module_init freed. 2015-01-20 11:38:32 +10:30
nmi.c s390: fix machine check handling 2014-12-01 11:06:55 +01:00
os_info.c
perf_cpum_cf.c s390: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
perf_cpum_cf_events.c
perf_cpum_sf.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-12-11 17:30:55 -08:00
perf_event.c
pgm_check.S s390: add support for vector extension 2014-10-09 09:14:13 +02:00
process.c s390/process: free vx save area when releasing tasks 2015-02-10 16:39:05 +01:00
processor.c s390: reintroduce diag 44 calls for cpu_relax() 2015-01-29 09:19:16 +01:00
ptrace.c s390/ptrace: always include vector registers in core files 2014-12-08 09:42:37 +01:00
reipl.S
reipl64.S
relocate_kernel.S
relocate_kernel64.S
runtime_instr.c
s390_ksyms.c
sclp.S s390/sclp: sign extend return value of _sclp_print_early() 2015-01-08 10:02:52 +01:00
setup.c s390: add z13 code generation support 2015-01-22 12:15:57 +01:00
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c s390/smp: remove check for CONFIG_ZFCPDUMP 2015-01-22 12:16:06 +01:00
stacktrace.c
suspend.c nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2014-10-09 22:26:04 -04:00
swsusp_asm64.S
sys_s390.c
syscalls.S s390: wire up execveat syscall 2014-12-18 13:37:17 +01:00
sysinfo.c s390: add SMT support 2015-01-22 12:16:01 +01:00
time.c s390/kprobes: make use of NOKPROBE_SYMBOL() 2014-10-27 13:27:28 +01:00
topology.c s390: add SMT support 2015-01-22 12:16:01 +01:00
traps.c s390/traps: die on translation exceptions 2014-11-21 08:49:33 +01:00
uprobes.c s390/uprobes: fix user space PER events 2015-01-12 10:24:58 +01:00
vdso.c
vmlinux.lds.S
vtime.c s390: add SMT support 2015-01-22 12:16:01 +01:00