[RAMEN9610-20751]binder: fix possible UAF when freeing buffer
authorTodd Kjos <tkjos@android.com>
Wed, 12 Jun 2019 20:29:27 +0000 (13:29 -0700)
committerrobot <robot@samsung.com>
Sun, 27 Oct 2019 17:54:00 +0000 (02:54 +0900)
commit2f19528c569456a5a5dcd637924fb1b89eab1f82
treeb18aef7a0c0350e4283d259f220a8d8d584fb3cf
parentc7252af1379c03cec617e04a07961ffe04186f05
[RAMEN9610-20751]binder: fix possible UAF when freeing buffer

commit a370003cc301d4361bae20c9ef615f89bf8d1e8a upstream.

There is a race between the binder driver cleaning
up a completed transaction via binder_free_transaction()
and a user calling binder_ioctl(BC_FREE_BUFFER) to
release a buffer. It doesn't matter which is first but
they need to be protected against running concurrently
which can result in a UAF.

Change-Id: I6b9b6a0b9e85b0953d5b53f62fb2ad35f62e1a23
Signed-off-by: Todd Kjos <tkjos@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c