]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
dma-mapping: Add vmap checks to dma_map_single()
authorKees Cook <keescook@chromium.org>
Tue, 29 Oct 2019 21:34:22 +0000 (14:34 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:05:10 +0000 (00:05 -0500)
commit5d14acaa5c9304cecaf2943e99d7e08f5188667d
tree30ef3a508d6e91f7c0cea283d8b03be05ad14bf8
parent4f453636271d3c10f9fdbd061eab6d531a665645
dma-mapping: Add vmap checks to dma_map_single()

BugLink: https://bugs.launchpad.net/bugs/1860816
[ Upstream commit 4544b9f25e70eae9f70a243de0cc802aa5c8cb69 ]

As we've seen from USB and other areas[1], we need to always do runtime
checks for DMA operating on memory regions that might be remapped. This
adds vmap checks (similar to those already in USB but missing in other
places) into dma_map_single() so all callers benefit from the checking.

[1] https://git.kernel.org/linus/3840c5b78803b2b6cc1ff820100a74a092c40cbb

Suggested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
[hch: fixed the printk message]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/linux/dma-mapping.h