diff options
author | Todd Kjos <tkjos@google.com> | 2017-11-10 15:30:27 -0800 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2017-11-20 21:15:59 +0530 |
commit | ea5c00bef187a73cbc2702273b25b06796a87267 (patch) | |
tree | 5f97ce4312f3b09d6e4935eb2815378f1f7a864e /include/scsi/scsi_eh.h | |
parent | 3f883f9b5cf0d8361f28cabba13c36da68f0ed85 (diff) |
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>
Diffstat (limited to 'include/scsi/scsi_eh.h')
0 files changed, 0 insertions, 0 deletions