]> 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)
commit178cbc5f6e7223d50fb5b2c99c137e3cb8d9cc77
tree629130481205f514709c3cc84a2f5debed28f8cd
parente1ccf2965e255adbba1eee3dca54db3aed8f77f6
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