Todd Kjos 7f3dc0088b 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>
2017-12-18 15:47:12 +01:00
..
2017-11-14 16:54:12 -08:00
2017-12-08 09:58:10 -08:00
2017-11-16 12:47:46 -08:00
2017-11-16 12:47:46 -08:00
2017-11-14 16:49:31 -08:00
2017-11-17 14:58:01 -08:00
2017-11-15 13:46:33 -08:00
2017-11-13 21:14:07 -08:00
2017-12-10 08:26:59 -08:00
2017-11-16 09:10:59 -08:00
2017-11-15 13:35:43 -08:00
2017-11-17 20:16:20 -08:00
2017-11-16 09:10:59 -08:00
2017-11-13 01:34:14 +01:00
2017-12-06 10:53:02 -08:00
2017-11-14 18:09:31 -08:00
2017-12-01 12:19:48 -08:00
2017-12-08 13:18:47 -08:00
2017-11-16 16:05:01 -08:00
2017-11-15 13:46:33 -08:00
2017-12-01 08:14:22 -05:00
2017-11-13 12:10:24 -08:00
2017-11-17 09:51:57 -08:00
2017-11-16 09:10:59 -08:00
2017-11-16 09:10:59 -08:00
2017-11-15 10:56:56 -08:00
2017-11-13 21:14:07 -08:00
2017-11-16 13:06:27 -08:00
2017-11-22 21:09:18 -10:00
2017-11-16 09:15:57 -08:00
2017-11-17 20:14:10 -08:00
2017-11-16 16:05:01 -08:00
2017-11-17 20:12:08 -08:00
2017-12-05 10:31:32 -08:00
2017-11-14 16:54:12 -08:00
2017-11-14 16:47:47 -08:00
2017-12-02 21:31:03 -05:00
2017-11-20 21:50:24 -10:00
2017-11-16 09:10:59 -08:00
2017-11-16 09:10:59 -08:00
2017-12-08 12:53:43 -08:00