binder: fix possible UAF when freeing buffer
authorTodd Kjos <tkjos@android.com>
Wed, 12 Jun 2019 20:29:27 +0000 (13:29 -0700)
committerJan Altensen <info@stricted.net>
Tue, 15 Oct 2019 12:36:06 +0000 (08:36 -0400)
commite91f738d79e0d76c6ef7fc8342f1eab5e03a0189
tree823382b74741a2f029e81db177cd491d2b4e44cf
parentc623df986637798acebe5f8e2ef35951d3f58ceb
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.

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