linux/drivers/virt/coco
Li RongQing 1429ae7b7d virt: tdx-guest: Just leak decrypted memory on unrecoverable errors
commit 27834971f6 upstream.

In CoCo VMs it is possible for the untrusted host to cause
set_memory_decrypted() to fail such that an error is returned
and the resulting memory is shared. Callers need to take care
to handle these errors to avoid returning decrypted (shared)
memory to the page allocator, which could lead to functional
or security issues.

Leak the decrypted memory when set_memory_decrypted() fails,
and don't need to print an error since set_memory_decrypted()
will call WARN_ONCE().

Fixes: f4738f56d1 ("virt: tdx-guest: Add Quote generation support using TSM_REPORTS")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240619111801.25630-1-lirongqing%40baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-01-02 10:34:22 +01:00
..
efi_secret virt: efi_secret: Convert to platform remove callback returning void 2024-03-09 11:37:18 +01:00
pkvm-guest drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails 2024-12-14 20:03:17 +01:00
sev-guest virt: sev-guest: Ensure the SNP guest messages do not exceed a page 2024-08-27 10:35:38 +02:00
tdx-guest virt: tdx-guest: Just leak decrypted memory on unrecoverable errors 2025-01-02 10:34:22 +01:00
Kconfig drivers/virt: pkvm: Add initial support for running as a protected guest 2024-08-30 16:30:41 +01:00
Makefile drivers/virt: pkvm: Add initial support for running as a protected guest 2024-08-30 16:30:41 +01:00
tsm.c x86/sev: Extend the config-fs attestation support for an SVSM 2024-06-17 20:42:57 +02:00