linux/drivers/virt/coco
Zubin Mithra c3fd16c3b9 virt: tdx-guest: Fix handling of host controlled 'quote' buffer length
Validate host controlled value `quote_buf->out_len` that determines how
many bytes of the quote are copied out to guest userspace. In TDX
environments with remote attestation, quotes are not considered private,
and can be forwarded to an attestation server.

Catch scenarios where the host specifies a response length larger than
the guest's allocation, or otherwise races modifying the response while
the guest consumes it.

This prevents contents beyond the pages allocated for `quote_buf`
(up to TSM_REPORT_OUTBLOB_MAX) from being read out to guest userspace,
and possibly forwarded in attestation requests.

Recall that some deployments want per-container configs-tsm-report
interfaces, so the leak may cross container protection boundaries, not
just local root.

Fixes: f4738f56d1 ("virt: tdx-guest: Add Quote generation support using TSM_REPORTS")
Cc: stable@vger.kernel.org
Signed-off-by: Zubin Mithra <zsm@google.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2026-03-20 21:05:50 -07:00
..
arm-cca-guest configfs-tsm: Namespace TSM report symbols 2025-05-02 12:52:16 -07:00
efi_secret arm64: Enable EFI secret area Securityfs support 2025-09-19 10:12:01 +01:00
guest Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pkvm-guest drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails 2024-12-03 18:10:20 +00:00
sev-guest treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
tdx-guest virt: tdx-guest: Fix handling of host controlled 'quote' buffer length 2026-03-20 21:05:50 -07:00
Kconfig virt: Fix Kconfig warning when selecting TSM without VIRT_DRIVERS 2025-12-04 17:34:16 -08:00
Makefile coco/tsm: Introduce a core device for TEE Security Managers 2025-11-03 19:27:40 -08:00
tsm-core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00