]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: zero memory returned from dma_alloc_*
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Dec 2018 08:00:40 +0000 (09:00 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 Dec 2018 07:13:52 +0000 (08:13 +0100)
commit00f1c0702d662465b901f1f427c615d30918e755
tree629130481205f514709c3cc84a2f5debed28f8cd
parent331442fa5260203bcfa2bf89b4a6288c3b92f6d9
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]
14 files changed:
arch/alpha/kernel/pci_iommu.c
arch/arc/mm/dma.c
arch/c6x/mm/dma-coherent.c
arch/m68k/kernel/dma.c
arch/microblaze/mm/consistent.c
arch/openrisc/kernel/dma.c
arch/parisc/kernel/pci-dma.c
arch/s390/pci/pci_dma.c
arch/sparc/kernel/ioport.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/xtensa/kernel/pci-dma.c
drivers/misc/mic/host/mic_boot.c
kernel/dma/virt.c