diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2020-03-04 12:45:27 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-03-17 11:52:58 +0100 |
commit | 17c4a2ae15a7aaefe84bdb271952678c5c9cd8e1 (patch) | |
tree | aad4fbfa8cdc5d4111992b12a82c42ed3e61a30d /kernel/irq/debugfs.c | |
parent | x86: Don't let pgprot_modify() change the page encryption bit (diff) | |
download | linux-17c4a2ae15a7aaefe84bdb271952678c5c9cd8e1.tar.xz linux-17c4a2ae15a7aaefe84bdb271952678c5c9cd8e1.zip |
dma-mapping: Fix dma_pgprot() for unencrypted coherent pages
When dma_mmap_coherent() sets up a mapping to unencrypted coherent memory
under SEV encryption and sometimes under SME encryption, it will actually
set up an encrypted mapping rather than an unencrypted, causing devices
that DMAs from that memory to read encrypted contents. Fix this.
When force_dma_unencrypted() returns true, the linear kernel map of the
coherent pages have had the encryption bit explicitly cleared and the
page content is unencrypted. Make sure that any additional PTEs we set
up to these pages also have the encryption bit cleared by having
dma_pgprot() return a protection with the encryption bit cleared in this
case.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lkml.kernel.org/r/20200304114527.3636-3-thomas_os@shipmail.org
Diffstat (limited to 'kernel/irq/debugfs.c')
0 files changed, 0 insertions, 0 deletions