binder: protect against stale pointers in print_binder_transaction
authorTodd Kjos <tkjos@android.com>
Thu, 29 Jun 2017 19:02:09 +0000 (12:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jul 2017 12:48:24 +0000 (14:48 +0200)
commit5f2f63696c552081bc90fb0ef80c94def33ba421
treea6c978d72bd33ee727ad7bde2716883d02a7c6eb
parent2c1838dc6817dd28cf24ba0c57cc8693be9bbfc5
binder: protect against stale pointers in print_binder_transaction

When printing transactions there were several race conditions
that could cause a stale pointer to be deferenced. Fixed by
reading the pointer once and using it if valid (which is
safe). The transaction buffer also needed protection via proc
lock, so it is only printed if we are holding the correct lock.

Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c