Commit 4d8d4137 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Revert "staging: vc04_services: prevent integer overflow in create_pagelist()"

This reverts commit cf07331c which was
commit ca641bae 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
	4807f2c0.
Reported-by: default avatarMartin Weinelt <martin@linuxlounge.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce8bda09
...@@ -381,18 +381,9 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, ...@@ -381,18 +381,9 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
int run, addridx, actual_pages; int run, addridx, actual_pages;
unsigned long *need_release; unsigned long *need_release;
if (count >= INT_MAX - PAGE_SIZE)
return NULL;
offset = (unsigned int)buf & (PAGE_SIZE - 1); offset = (unsigned int)buf & (PAGE_SIZE - 1);
num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE; 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; *ppagelist = NULL;
/* Allocate enough storage to hold the page pointers and the page /* Allocate enough storage to hold the page pointers and the page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment