dma-direct: always leak memory that can't be re-encrypted
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Nov 2021 14:41:01 +0000 (15:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:03 +0000 (10:23 +0200)
commit5beb74d11eabd745d75bc91947b2721d2bd95deb
tree461b4ca7bb28254e3f6426f183721ec7286e91f3
parent9ba801c80c47c1283a570248d8ea3d139fb190d7
dma-direct: always leak memory that can't be re-encrypted

[ Upstream commit a90cf30437489343b8386ae87b4827b6d6c3ed50 ]

We must never let unencrypted memory go back into the general page pool.
So if we fail to set it back to encrypted when freeing DMA memory, leak
the memory instead and warn the user.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/dma/direct.c