FROMLIST: binder: protect against stale pointers in print_binder_transaction
authorTodd Kjos <tkjos@google.com>
Fri, 21 Apr 2017 21:32:11 +0000 (14:32 -0700)
committerTodd Kjos <tkjos@google.com>
Thu, 13 Jul 2017 15:34:22 +0000 (08:34 -0700)
commit6d241a4bce4a388dc0de6962d7845a18c1a15124
tree796286cabc975d68609d0bf1800049814f357399
parent5346bf3a4104a2829f7974cfe9d08d75fd6cdea3
FROMLIST: binder: protect against stale pointers in print_binder_transaction

(from https://patchwork.kernel.org/patch/9817761/)

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.

Change-Id: I9a03129e08eaab4b8a5646eecafaf10e343dbdea
Signed-off-by: Todd Kjos <tkjos@google.com>
drivers/android/binder.c