]> git.baikalelectronics.ru Git - kernel.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>
Sat, 14 Dec 2019 08:10:47 +0000 (09:10 +0100)
commit1ce4555b7f8484587f39b13fd53d745aa4b3207c
tree81e6f0d2bf4db7382e7aaf6064ffd0e481dca03b
parentc2b40c72387f4988cacecdfccec3ade6f9dbaa4a
binder: fix incorrect calculation for num_valid

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: c12ae700d42e ("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