lkml.org 
[lkml]   [2018]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/3] udmabuf: check that __pad is zero
Date
Reported-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 9edabce0b8..964beadd11 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -134,6 +134,8 @@ static long udmabuf_create(const struct udmabuf_create_list *head,

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))
--
2.9.3
\
 
 \ /
  Last update: 2018-09-12 08:35    [W:0.039 / U:7.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site