Patch "dma-direct: add missing set_memory_decrypted() for coherent mapping" has been added to the 5.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dma-direct: add missing set_memory_decrypted() for coherent mapping

to the 5.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dma-direct-add-missing-set_memory_decrypted-for-cohe.patch
and it can be found in the queue-5.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fb468faae7799a404fba70c54d1e9864c8d4b222
Author: David Rientjes <rientjes@xxxxxxxxxx>
Date:   Thu Jun 11 12:20:32 2020 -0700

    dma-direct: add missing set_memory_decrypted() for coherent mapping
    
    [ Upstream commit 1a2b3357e860d890f8045367b179c7e7e802cd71 ]
    
    When a coherent mapping is created in dma_direct_alloc_pages(), it needs
    to be decrypted if the device requires unencrypted DMA before returning.
    
    Fixes: 3acac065508f ("dma-mapping: merge the generic remapping helpers into dma-direct")
    Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 98c445dcb308b..2270930f36f83 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -161,6 +161,12 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size,
 				__builtin_return_address(0));
 		if (!ret)
 			goto out_free_pages;
+		if (force_dma_unencrypted(dev)) {
+			err = set_memory_decrypted((unsigned long)ret,
+						   1 << get_order(size));
+			if (err)
+				goto out_free_pages;
+		}
 		memset(ret, 0, size);
 		goto done;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux