diff options
author | Andrzej Pietrasiewicz | 2011-03-02 09:12:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab | 2011-03-22 04:54:30 -0300 |
commit | 941f896071c5c9120c8473c77246beaf36155247 (patch) | |
tree | 3a07d6ce2ee34f74d7e8a3cae4dbf71512302cc0 | |
parent | 72f1fc33a76a115e8c67f7b052bd7f6e129cda50 (diff) |
[media] v4l2: vb2-dma-sg: fix potential security hole
Memory allocated by alloc_page() function might contain some potentially
important data from other system processes. The patch adds a flag to
zero the allocated page before giving it to videobuf2 (and then to
userspace).
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/videobuf2-dma-sg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/videobuf2-dma-sg.c b/drivers/media/video/videobuf2-dma-sg.c index d5311ff3fab0..b2d9485aac75 100644 --- a/drivers/media/video/videobuf2-dma-sg.c +++ b/drivers/media/video/videobuf2-dma-sg.c @@ -62,7 +62,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size) goto fail_pages_array_alloc; for (i = 0; i < buf->sg_desc.num_pages; ++i) { - buf->pages[i] = alloc_page(GFP_KERNEL); + buf->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO); if (NULL == buf->pages[i]) goto fail_pages_alloc; sg_set_page(&buf->sg_desc.sglist[i], |