linux-stable/drivers/hv
Michael Kelley a9212a4e29 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:14:47 +02:00
..
Kconfig x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:17:30 -04:00
Makefile
channel.c Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted 2024-05-17 12:14:47 +02:00
channel_mgmt.c
connection.c Drivers: hv: vmbus: Leak pages if set_memory_encrypted() fails 2024-05-17 12:14:47 +02:00
hv.c
hv_balloon.c
hv_common.c iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops() 2023-12-12 10:18:45 +01: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: Allow implicit ICTIMESYNCFLAG_SYNC 2024-03-01 08:19:06 +00:00
hv_utils_transport.c
hv_utils_transport.h
hyperv_vmbus.h
ring_buffer.c
vmbus_drv.c Drivers: hv: vmbus: make hv_bus const 2024-03-03 02:32:35 +00:00