linux-hardened/drivers/staging/android
Vinayak Menon ddac7d5fba staging: binder: add vm_fault handler
An issue was observed when a userspace task exits.
The page which hits error here is the zero page.
In binder mmap, the whole of vma is not mapped.
On a task crash, when debuggerd reads the binder regions,
the unmapped areas fall to do_anonymous_page in handle_pte_fault,
due to the absence of a vm_fault handler. This results in
zero page being mapped. Later in zap_pte_range, vm_normal_page
returns zero page in the case of VM_MIXEDMAP and it results in the
error.

BUG: Bad page map in process mediaserver  pte:9dff379f pmd:9bfbd831
page:c0ed8e60 count:1 mapcount:-1 mapping:  (null) index:0x0
page flags: 0x404(referenced|reserved)
addr:40c3f000 vm_flags:10220051 anon_vma:  (null) mapping:d9fe0764 index:fd
vma->vm_ops->fault:   (null)
vma->vm_file->f_op->mmap: binder_mmap+0x0/0x274
CPU: 0 PID: 1463 Comm: mediaserver Tainted: G        W    3.10.17+ #1
[<c001549c>] (unwind_backtrace+0x0/0x11c) from [<c001200c>] (show_stack+0x10/0x14)
[<c001200c>] (show_stack+0x10/0x14) from [<c0103d78>] (print_bad_pte+0x158/0x190)
[<c0103d78>] (print_bad_pte+0x158/0x190) from [<c01055f0>] (unmap_single_vma+0x2e4/0x598)
[<c01055f0>] (unmap_single_vma+0x2e4/0x598) from [<c010618c>] (unmap_vmas+0x34/0x50)
[<c010618c>] (unmap_vmas+0x34/0x50) from [<c010a9e4>] (exit_mmap+0xc8/0x1e8)
[<c010a9e4>] (exit_mmap+0xc8/0x1e8) from [<c00520f0>] (mmput+0x54/0xd0)
[<c00520f0>] (mmput+0x54/0xd0) from [<c005972c>] (do_exit+0x360/0x990)
[<c005972c>] (do_exit+0x360/0x990) from [<c0059ef0>] (do_group_exit+0x84/0xc0)
[<c0059ef0>] (do_group_exit+0x84/0xc0) from [<c0066de0>] (get_signal_to_deliver+0x4d4/0x548)
[<c0066de0>] (get_signal_to_deliver+0x4d4/0x548) from [<c0011500>] (do_signal+0xa8/0x3b8)

Add a vm_fault handler which returns VM_FAULT_SIGBUS, and prevents the
wrong fallback to do_anonymous_page.

Signed-off-by: Vinayak Menon <vinayakm.list@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:42:06 -07:00
..
ion staging: ion: fixup invalid kfree() calls on heap destroy 2014-06-19 19:58:56 -07:00
trace
uapi staging: android: uapi: fix coding style 2014-04-16 20:17:31 -07:00
alarm-dev.c staging: alarm-dev: Set the license to GPL 2014-06-20 08:28:01 -07:00
android_alarm.h staging: android: Split uapi out of android_alarm.h 2014-02-18 11:03:28 -08:00
ashmem.c staging: ashmem: Avoid deadlock between read and mmap calls 2014-02-07 09:03:16 -08:00
ashmem.h staging: android: Split uapi out of ashmem.h 2014-02-18 11:03:28 -08:00
binder.c staging: binder: add vm_fault handler 2014-07-08 15:42:06 -07:00
binder.h staging: binder: Support concurrent 32 bit and 64 bit processes. 2014-02-24 16:29:40 -08:00
binder_trace.h staging: binder: Support concurrent 32 bit and 64 bit processes. 2014-02-24 16:29:40 -08:00
Kconfig staging: alarm-dev: Support to Compile as Module 2014-06-19 17:32:09 -07:00
logger.c staging: android: fix missing a blank line after declarations 2014-05-03 19:46:30 -04:00
logger.h
lowmemorykiller.c staging: android: lowmemorykiller: neglect swap cached pages in other_file 2014-02-27 14:51:27 -08:00
Makefile ion: Reenable the build 2013-12-15 09:40:11 -08:00
sw_sync.c staging: android: fix missing a blank line after declarations 2014-05-03 19:46:30 -04:00
sw_sync.h staging: android: split uapi out of sync.h and sw_sync.h 2014-02-18 11:03:28 -08:00
sync.c staging: android: describe use of memory barrier on sync.c 2014-05-25 11:09:14 -07:00
sync.h staging: android: split uapi out of sync.h and sw_sync.h 2014-02-18 11:03:28 -08:00
timed_gpio.c staging : android: Fixes a coding style issue in timed_gpio.c 2014-05-24 01:54:55 +09:00
timed_gpio.h
timed_output.c staging: android: timed_output: fix use after free of dev 2014-06-19 17:33:37 -07:00
timed_output.h staging: android: timed_output: fix a checkpatch warning 2014-02-11 12:27:30 -08:00
TODO