linux-stable/drivers/hv
Michael Kelley 82f9e213b1 Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted
[ Upstream commit 30d18df656 ]

In CoCo VMs it is possible for the untrusted host to cause
set_memory_encrypted() or 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.

The VMBus ring buffer code could free decrypted/shared pages if
set_memory_decrypted() fails. Check the decrypted field in the struct
vmbus_gpadl for the ring buffers to decide whether to free the memory.

Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/r/20240311161558.1310-6-mhklinux@outlook.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20240311161558.1310-6-mhklinux@outlook.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-17 12:02:17 +02:00
..
channel.c Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted 2024-05-17 12:02:17 +02:00
channel_mgmt.c Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-05-23 18:53:16 +00:00
connection.c Drivers: hv: vmbus: Leak pages if set_memory_encrypted() fails 2024-05-17 12:02:17 +02:00
hv.c x86/hyperv: Remove hv_isolation_type_en_snp 2023-08-25 00:04:57 +00:00
hv_balloon.c hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
hv_common.c hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
hv_debugfs.c
hv_fcopy.c
hv_kvp.c
hv_snapshot.c
hv_trace.c
hv_trace.h
hv_trace_balloon.h
hv_util.c
hv_utils_transport.c
hv_utils_transport.h
hyperv_vmbus.h Drivers: hv: vmbus: Bring the post_msg_page back for TDX VMs with the paravisor 2023-08-25 00:04:57 +00:00
Kconfig x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:20:06 -04:00
Makefile
ring_buffer.c Drivers: hv: vmbus: Remove second way of mapping ring buffers 2023-04-17 19:19:04 +00:00
vmbus_drv.c Drivers: hv: vmbus: Don't dereference ACPI root object handle 2023-08-22 01:18:32 +00:00