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)
commit518a2f1925c3165befbf06b75e07636549d92c1c
tree629130481205f514709c3cc84a2f5debed28f8cd
parent6c503d0d88db9d57c1dc4c87175c94766b6a6c61
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