summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-05-15 12:38:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-20 09:26:04 +0200
commitca641bae6da977d638458e78cd1487b6160a2718 (patch)
tree3f24b8331b82d8cbd7675298dccb8c3518538408 /arch/powerpc/kernel
parentca4e4efbefbbdde0a7bb3023ea08d491f4daf9b9 (diff)
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 'arch/powerpc/kernel')
0 files changed, 0 insertions, 0 deletions