]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
binder: fix incorrect calculation for num_valid
authorTodd Kjos <tkjos@android.com>
Fri, 13 Dec 2019 20:25:31 +0000 (12:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:06:53 +0000 (20:06 +0100)
commit409579300981183be71034b483d1f5eedbbaed2d
tree6e0a24f6e25d74673ea602341072616f5c93c12e
parentb309d5aeaa8342d9b6bbcd94c256a1cc247f6fad
binder: fix incorrect calculation for num_valid

commit 16981742717b04644a41052570fb502682a315d2 upstream.

For BINDER_TYPE_PTR and BINDER_TYPE_FDA transactions, the
num_valid local was calculated incorrectly causing the
range check in binder_validate_ptr() to miss out-of-bounds
offsets.

Fixes: bde4a19fc04f ("binder: use userspace pointer as base of buffer space")
Signed-off-by: Todd Kjos <tkjos@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191213202531.55010-1-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c