1
0
Fork 0
alistair23-linux/drivers/staging/vc04_services
Dan Carpenter ca641bae6d 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: 71bad7f086 ("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>
2019-05-20 09:26:04 +02:00
..
bcm2835-audio staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
bcm2835-camera Staging: vc04_services: Fix a couple error codes 2019-05-20 09:26:04 +02:00
interface staging: vc04_services: prevent integer overflow in create_pagelist() 2019-05-20 09:26:04 +02:00
Kconfig staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
Makefile staging: vc04_services: Remove defines from Makefile 2018-05-06 19:04:43 -07:00