[RAMEN9610-21231]UPSTREAM: binder: check for overflow when alloc for security context
authorTodd Kjos <tkjos@android.com>
Wed, 24 Apr 2019 19:31:18 +0000 (12:31 -0700)
committerlingsen1 <lingsen1@lenovo.com>
Wed, 12 Feb 2020 03:17:30 +0000 (11:17 +0800)
commitc39bfcc6276d3e2c85fb805e226cc76a5c97573e
tree789702337872995567a9fca9681f13ad99bbd3db
parent1b34d326dec64cc73d5ca8b0e43f03d9b251eee0
[RAMEN9610-21231]UPSTREAM: binder: check for overflow when alloc for security context

commit 0b0509508beff65c1d50541861bc0d4973487dc5 upstream.

When allocating space in the target buffer for the security context,
make sure the extra_buffers_size doesn't overflow. This can only
happen if the given size is invalid, but an overflow can turn it
into a valid size. Fail the transaction if an overflow is detected.

Bug: 130571081
Change-Id: Ibaec652d2073491cc426a4a24004a848348316bf
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c