linux-stable-rt/arch/s390/kernel
Jarod Wilson 3d6e48f433 [S390] CVE-2008-1514: prevent ptrace padding area read/write in 31-bit mode
When running a 31-bit ptrace, on either an s390 or s390x kernel,
reads and writes into a padding area in struct user_regs_struct32
will result in a kernel panic.

This is also known as CVE-2008-1514.

Test case available here:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/tests/ptrace-tests/tests/user-area-padding.c?cvsroot=systemtap

Steps to reproduce:
1) wget the above
2) gcc -o user-area-padding-31bit user-area-padding.c -Wall -ggdb2 -D_GNU_SOURCE -m31
3) ./user-area-padding-31bit
<panic>

Test status
-----------
Without patch, both s390 and s390x kernels panic. With patch, the test case,
as well as the gdb testsuite, pass without incident, padding area reads
returning zero, writes ignored.

Nb: original version returned -EINVAL on write attempts, which broke the
gdb test and made the test case slightly unhappy, Jan Kratochvil suggested
the change to return 0 on write attempts.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-09 12:39:06 +02:00
..
Makefile
asm-offsets.c
audit.c
audit.h
base.S
bitmap.S
compat_audit.c
compat_exec_domain.c
compat_linux.c
compat_linux.h
compat_ptrace.h [S390] CVE-2008-1514: prevent ptrace padding area read/write in 31-bit mode 2008-09-09 12:39:06 +02:00
compat_signal.c
compat_wrapper.S [S390] Wire up new syscalls. 2008-08-01 16:39:32 +02:00
cpcmd.c
crash.c
debug.c
diag.c
dis.c
early.c
ebcdic.c
entry.S
entry.h
entry64.S
head.S
head31.S
head64.S
init_task.c
ipl.c [S390] ipl: Reboot from alternate device does not work when booting from file 2008-08-01 16:39:30 +02:00
irq.c
kprobes.c stop_machine: Wean existing callers off stop_machine_run() 2008-07-28 12:16:31 +10:00
machine_kexec.c
mem_detect.c [S390] Remove diag 0x260 call from memory detection. 2008-08-01 16:39:34 +02:00
module.c
process.c [S390] Fix uninitialized spinlock use 2008-08-21 19:46:39 +02:00
ptrace.c [S390] CVE-2008-1514: prevent ptrace padding area read/write in 31-bit mode 2008-09-09 12:39:06 +02:00
reipl.S
reipl64.S
relocate_kernel.S
relocate_kernel64.S
s390_ext.c
s390_ksyms.c
setup.c s390: use virtio_console for KVM on s390 2008-07-25 12:06:07 +10:00
signal.c
smp.c [S390] Remove unneeded spinlock initialization. 2008-08-21 19:46:39 +02:00
stacktrace.c
sys_s390.c
syscalls.S [S390] Wire up new syscalls. 2008-08-01 16:39:32 +02:00
time.c [S390] stp: fix section mismatch warning. 2008-08-01 16:39:34 +02:00
topology.c S390 topology: don't use kthread() for arch_reinit_sched_domains() 2008-07-25 10:53:40 -07:00
traps.c
vmlinux.lds.S [S390] Fix linker script. 2008-08-25 18:15:01 +02:00
vtime.c