diff options
| author | Yisheng Xie <xieyisheng1@huawei.com> | 2018-02-28 14:59:22 +0800 |
|---|---|---|
| committer | Joel Fernandes <joelaf@google.com> | 2018-03-19 15:10:21 -0700 |
| commit | 9a42d514a637cfcbac4000c0d4528e0a3b9403c5 (patch) | |
| tree | bb9e2e829929baf5dfea0b18a7e083addbb5499d /security/selinux/hooks.c | |
| parent | b6c49d2852dd45f78d13302d78a8a53ddc743ae1 (diff) | |
staging: android: ashmem: Fix possible deadlock in ashmem_ioctl
ashmem_mutex may create a chain of dependencies like:
CPU0 CPU1
mmap syscall ioctl syscall
-> mmap_sem (acquired) -> ashmem_ioctl
-> ashmem_mmap -> ashmem_mutex (acquired)
-> ashmem_mutex (try to acquire) -> copy_from_user
-> mmap_sem (try to acquire)
There is a lock odering problem between mmap_sem and ashmem_mutex causing
a lockdep splat[1] during a syzcaller test. This patch fixes the problem
by move copy_from_user out of ashmem_mutex.
[1] https://www.spinics.net/lists/kernel/msg2733200.html
Fixes: ce8a3a9e76d0 (staging: android: ashmem: Fix a race condition in pin ioctls)
Reported-by: syzbot+d7a918a7a8e1c952bc36@syzkaller.appspotmail.com
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions
