diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-05-15 12:38:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-20 09:26:04 +0200 |
commit | ca641bae6da977d638458e78cd1487b6160a2718 (patch) | |
tree | 3f24b8331b82d8cbd7675298dccb8c3518538408 /drivers/staging/kpc2000/Kconfig | |
parent | ca4e4efbefbbdde0a7bb3023ea08d491f4daf9b9 (diff) | |
download | linux-stable-ca641bae6da977d638458e78cd1487b6160a2718.tar.gz linux-stable-ca641bae6da977d638458e78cd1487b6160a2718.tar.bz2 linux-stable-ca641bae6da977d638458e78cd1487b6160a2718.zip |
staging: vc04_services: prevent integer overflow in create_pagelist()
The create_pagelist() "count" parameter comes from the user in
vchiq_ioctl() and it could overflow. If you look at how create_page()
is called in vchiq_prepare_bulk_data(), then the "size" variable is an
int so it doesn't make sense to allow negatives or larger than INT_MAX.
I don't know this code terribly well, but I believe that typical values
of "count" are typically quite low and I don't think this check will
affect normal valid uses at all.
The "pagelist_size" calculation can also overflow on 32 bit systems, but
not on 64 bit systems. I have added an integer overflow check for that
as well.
The Raspberry PI doesn't offer the same level of memory protection that
x86 does so these sorts of bugs are probably not super critical to fix.
Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000/Kconfig')
0 files changed, 0 insertions, 0 deletions