]> git.baikalelectronics.ru Git - kernel.git/commit
s390/signal: set correct address space control
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 7 Nov 2012 09:44:08 +0000 (10:44 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 12 Nov 2012 15:24:38 +0000 (16:24 +0100)
commitfc47147bfd4530a0af26197c1d3a6d0bf6594396
tree1b1f45f608ab83a8b4bf741b6f439a473a6b82b6
parent28d7230bf57b8eec6f73731073910a864e140197
s390/signal: set correct address space control

If user space is running in primary mode it can switch to secondary
or access register mode, this is used e.g. in the clock_gettime code
of the vdso. If a signal is delivered to the user space process while
it has been running in access register mode the signal handler is
executed in access register mode as well which will result in a crash
most of the time.

Set the address space control bits in the PSW to the default for the
execution of the signal handler and make sure that the previous
address space control is restored on signal return. Take care
that user space can not switch to the kernel address space by
modifying the registers in the signal frame.

Cc: stable@vger.kernel.org
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/compat.h
arch/s390/include/uapi/asm/ptrace.h
arch/s390/kernel/compat_signal.c
arch/s390/kernel/signal.c