From 4e0898f30f13c1d492b86a5404b73d8b6baa40af Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 12 Sep 2018 06:46:48 +0200 Subject: udmabuf: check that __pad is zero Reported-by: Yann Droneaud Signed-off-by: Gerd Hoffmann --- drivers/dma-buf/udmabuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 740d6e426ee9..c35c7cd5516f 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -219,6 +219,8 @@ static long udmabuf_create(struct miscdevice *device, pglimit = (size_limit_mb * 1024 * 1024) >> PAGE_SHIFT; for (i = 0; i < head->count; i++) { + if (list[i].__pad) + goto err; if (!IS_ALIGNED(list[i].offset, PAGE_SIZE)) goto err; if (!IS_ALIGNED(list[i].size, PAGE_SIZE)) -- cgit