summaryrefslogtreecommitdiff
path: root/arch/openrisc/kernel/dma.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-12-14 11:00:40 +0300
committerChristoph Hellwig <hch@lst.de>2018-12-20 10:13:52 +0300
commit518a2f1925c3165befbf06b75e07636549d92c1c (patch)
tree629130481205f514709c3cc84a2f5debed28f8cd /arch/openrisc/kernel/dma.c
parent6c503d0d88db9d57c1dc4c87175c94766b6a6c61 (diff)
downloadlinux-518a2f1925c3165befbf06b75e07636549d92c1c.tar.xz
dma-mapping: zero memory returned from dma_alloc_*
If we want to map memory from the DMA allocator to userspace it must be zeroed at allocation time to prevent stale data leaks. We already do this on most common architectures, but some architectures don't do this yet, fix them up, either by passing GFP_ZERO when we use the normal page allocator or doing a manual memset otherwise. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k] Acked-by: Sam Ravnborg <sam@ravnborg.org> [sparc]
Diffstat (limited to 'arch/openrisc/kernel/dma.c')
-rw-r--r--arch/openrisc/kernel/dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/openrisc/kernel/dma.c b/arch/openrisc/kernel/dma.c
index 159336adfa2f..f79457cb3741 100644
--- a/arch/openrisc/kernel/dma.c
+++ b/arch/openrisc/kernel/dma.c
@@ -89,7 +89,7 @@ arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
.mm = &init_mm
};
- page = alloc_pages_exact(size, gfp);
+ page = alloc_pages_exact(size, gfp | __GFP_ZERO);
if (!page)
return NULL;