linux-stable/drivers/hv
Michael Kelley 2f622008bf 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 11:56:08 +02:00
..
Kconfig
Makefile
channel.c Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted 2024-05-17 11:56:08 +02:00
channel_mgmt.c
connection.c
hv.c
hv_balloon.c
hv_common.c
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
ring_buffer.c
vmbus_drv.c Drivers: hv: vmbus: Don't dereference ACPI root object handle 2023-09-13 09:42:59 +02:00