linux/arch/s390
Heiko Carstens 008c2e8f24 s390/mm: fix fault handling for page table walk case
Make sure the kernel does not incorrectly create a SIGBUS signal during
user space accesses:

For user space accesses in the switched addressing mode case the kernel
may walk page tables and access user address space via the kernel
mapping. If a page table entry is invalid the function __handle_fault()
gets called in order to emulate a page fault and trigger all the usual
actions like paging in a missing page etc. by calling handle_mm_fault().

If handle_mm_fault() returns with an error fixup handling is necessary.
For the switched addressing mode case all errors need to be mapped to
-EFAULT, so that the calling uaccess function can return -EFAULT to
user space.

Unfortunately the __handle_fault() incorrectly calls do_sigbus() if
VM_FAULT_SIGBUS is set. This however should only happen if a page fault
was triggered by a user space instruction. For kernel mode uaccesses
the correct action is to only return -EFAULT.
So user space may incorrectly see SIGBUS signals because of this bug.

For current machines this would only be possible for the switched
addressing mode case in conjunction with futex operations.

Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2012-07-30 11:03:09 +02:00
..
appldata s390/vtimer: rework virtual timer interface 2012-07-20 11:15:08 +02:00
boot s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
crypto s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
hypfs s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
include/asm s390/mm: downgrade page table after fork of a 31 bit process 2012-07-26 16:24:14 +02:00
kernel s390/ipl: Use diagnose 8 command separation 2012-07-26 10:07:26 +02:00
kvm KVM updates for the 3.6 merge window 2012-07-24 12:01:20 -07:00
lib s390/vtimer: rework virtual timer interface 2012-07-20 11:15:08 +02:00
math-emu s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
mm s390/mm: fix fault handling for page table walk case 2012-07-30 11:03:09 +02:00
oprofile s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
defconfig s390: update defconfig 2012-07-26 16:24:20 +02:00
Kbuild [S390] make arch/s390 subdirectories depend on config option 2011-12-27 11:27:12 +01:00
Kconfig s390/exceptions: sort exception table at build time 2012-07-26 10:07:25 +02:00
Kconfig.debug [S390] Write protect module text and RO data 2011-03-15 17:08:23 +01:00
Makefile s390: Use generic init_task 2012-05-05 13:00:25 +02:00