android: drivers: workaround debugfs race in binder
authorRiley Andrews <riandrews@android.com>
Mon, 9 Nov 2015 21:16:32 +0000 (13:16 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:54:24 +0000 (13:54 -0800)
commitaa29c32d396b6e7cf9192e607760fa1d6a56cc21
tree3d09aaa082df6d9e71a7bc11b609a0351abe9704
parent52354e599db683dad784f3d353ffe45bc248e2ec
android: drivers: workaround debugfs race in binder

If a /d/binder/proc/[pid] entry is kept open after linux has
torn down the associated process, binder_proc_show can deference
an invalid binder_proc that has been stashed in the debugfs
inode.  Validate that the binder_proc ptr passed into binder_proc_show
has not been freed by looking for it within the global process list
whilst the global lock is held. If the ptr is not valid, print nothing.

Bug: 19587483

Change-Id: Idd5ad79f5648b7eed49d1ec75ae93f9e12a74ee9
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/android/binder.c