]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dma/pool: Ensure DMA_DIRECT_REMAP allocations are decrypted
authorShanker Donthineni <sdonthineni@nvidia.com>
Mon, 11 Aug 2025 18:17:59 +0000 (13:17 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 13:26:30 +0000 (15:26 +0200)
commit76232793770feb4d47ec8f4961b45dd88eca2bcd
tree11b3465876de98dc1576faecced47e51d9eca79b
parent681a78127776b14a97b176cd440e56d1ee3d1460
dma/pool: Ensure DMA_DIRECT_REMAP allocations are decrypted

commit 89a2d212bdb4bc29bed8e7077abe054b801137ea upstream.

When CONFIG_DMA_DIRECT_REMAP is enabled, atomic pool pages are
remapped via dma_common_contiguous_remap() using the supplied
pgprot. Currently, the mapping uses
pgprot_dmacoherent(PAGE_KERNEL), which leaves the memory encrypted
on systems with memory encryption enabled (e.g., ARM CCA Realms).

This can cause the DMA layer to fail or crash when accessing the
memory, as the underlying physical pages are not configured as
expected.

Fix this by requesting a decrypted mapping in the vmap() call:
pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL))

This ensures that atomic pool memory is consistently mapped
unencrypted.

Cc: stable@vger.kernel.org
Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20250811181759.998805-1-sdonthineni@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/dma/pool.c