diff options
author | Todd Kjos <tkjos@android.com> | 2017-11-27 09:32:33 -0800 |
---|---|---|
committer | Martijn Coenen <maco@android.com> | 2018-07-17 12:48:06 +0200 |
commit | c88a3ec1ee64576a706432af3e8f1aee8e6e4d2e (patch) | |
tree | 11a674e8494e1bacbcc062be2207d48fe431fb29 /kernel/sched/core.c | |
parent | 96523f2450dc194ee8b914f9315fa6b609d172f3 (diff) |
UPSTREAM: binder: fix proc->files use-after-free
proc->files cleanup is initiated by binder_vma_close. Therefore
a reference on the binder_proc is not enough to prevent the
files_struct from being released while the binder_proc still has
a reference. This can lead to an attempt to dereference the
stale pointer obtained from proc->files prior to proc->files
cleanup. This has been seen once in task_get_unused_fd_flags()
when __alloc_fd() is called with a stale "files".
The fix is to protect proc->files with a mutex to prevent cleanup
while in use.
Signed-off-by: Todd Kjos <tkjos@google.com>
Cc: stable <stable@vger.kernel.org> # 4.14
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7f3dc0088b98533f17128058fac73cd8b2752ef1)
Change-Id: I40982bb0b4615bda5459538c20eb2a913964042c
Diffstat (limited to 'kernel/sched/core.c')
0 files changed, 0 insertions, 0 deletions