android_kernel_sony_sdm845/drivers/android
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Todd Kjos eb28a0f761 FROMLIST: binder: fix proc->files use-after-free
(from https://patchwork.kernel.org/patch/10058587/)

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 always use get_files_struct() to obtain struct_files
so that the refcount on the files_struct is used to prevent
a premature free. proc->files is removed since we get it every
time.

Bug: 69164715
Change-Id: I6431027d3d569e76913935c21885201505627982
Signed-off-by: Todd Kjos <tkjos@google.com>
Git-commit: 1d6b43334b
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2017-11-15 13:49:42 -08:00
..
binder.c FROMLIST: binder: fix proc->files use-after-free 2017-11-15 13:49:42 -08:00
binder_alloc.c FROMLIST: android: binder: Fix null ptr dereference in debug msg 2017-10-30 11:36:23 -07:00
binder_alloc.h FROMLIST: android: binder: Don't get mm from task 2017-09-21 18:53:05 +00:00
binder_alloc_selftest.c FROMLIST: android: binder: Add global lru shrinker to binder 2017-08-31 17:06:14 -07:00
binder_trace.h ANDROID: binder: Add tracing for binder priority inheritance. 2017-10-05 10:03:07 +02:00
Kconfig FROMLIST: android: binder: Add allocator selftest 2017-08-31 17:06:00 -07:00
Makefile FROMLIST: android: binder: Add allocator selftest 2017-08-31 17:06:00 -07:00