linux/arch/s390/mm
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
..
cmm.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
extmem.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
fault.c s390/mm: fix fault handling for page table walk case 2012-07-30 11:03:09 +02:00
gup.c thp: share get_huge_page_tail() 2011-11-02 16:06:58 -07:00
hugetlbpage.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
init.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
maccess.c s390/kernel: Introduce memcpy_absolute() function 2012-05-30 09:04:49 +02:00
Makefile [S390] Write protect module text and RO data 2011-03-15 17:08:23 +01:00
mmap.c s390/mm: downgrade page table after fork of a 31 bit process 2012-07-26 16:24:14 +02:00
page-states.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pageattr.c [S390] sparse: fix sparse warnings about missing prototypes 2011-10-30 15:16:46 +01:00
pgtable.c s390/mm: downgrade page table after fork of a 31 bit process 2012-07-26 16:24:14 +02:00
vmem.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00