diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-19 19:15:29 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-22 08:17:22 +0200 |
commit | 4d8d4137ccb1bf16f57cb26ee4e5c5368310758b (patch) | |
tree | ee0ab68917aa6f7122b4ca35f69229a2050dde5b /drivers/staging | |
parent | ce8bda09f597f964536c38392087702d8c9b451e (diff) |
Revert "staging: vc04_services: prevent integer overflow in create_pagelist()"
This reverts commit cf07331c8827c9e9e0b4274c9b60204c18592241 which was
commit ca641bae6da977d638458e78cd1487b6160a2718 upstream.
Martin writes:
This commit breaks the kernel build because the vchiq_pagelist_info
struct is not defined in v4.9.182.
It was only added in v4.10, in commit
4807f2c0e684e907c501cb96049809d7a957dbc2.
Reported-by: Martin Weinelt <martin@linuxlounge.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 94590ac5b3cf..f72eebc71dd8 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -381,18 +381,9 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, int run, addridx, actual_pages; unsigned long *need_release; - if (count >= INT_MAX - PAGE_SIZE) - return NULL; - offset = (unsigned int)buf & (PAGE_SIZE - 1); num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE; - if (num_pages > (SIZE_MAX - sizeof(PAGELIST_T) - - sizeof(struct vchiq_pagelist_info)) / - (sizeof(u32) + sizeof(pages[0]) + - sizeof(struct scatterlist))) - return NULL; - *ppagelist = NULL; /* Allocate enough storage to hold the page pointers and the page |