]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer
authorAndres Beltran <lkmlabelt@gmail.com>
Thu, 8 Apr 2021 16:14:39 +0000 (18:14 +0200)
committerWei Liu <wei.liu@kernel.org>
Fri, 14 May 2021 17:37:46 +0000 (17:37 +0000)
commitadae1e931acd8b430d31141a283ea06d4b705417
tree70799e7f212ce0f991b0a675625391b8adf606f3
parent03b30cc38dd3c3521dafb1cb2ac4ecd8470bbf0a
Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer

Pointers to ring-buffer packets sent by Hyper-V are used within the
guest VM. Hyper-V can send packets with erroneous values or modify
packet fields after they are processed by the guest. To defend
against these scenarios, return a copy of the incoming VMBus packet
after validating its length and offset fields in hv_pkt_iter_first().
In this way, the packet can no longer be modified by the host.

Signed-off-by: Andres Beltran <lkmlabelt@gmail.com>
Co-developed-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210408161439.341988-1-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/channel.c
drivers/hv/hv_fcopy.c
drivers/hv/hv_kvp.c
drivers/hv/hyperv_vmbus.h
drivers/hv/ring_buffer.c
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/rndis_filter.c
drivers/scsi/storvsc_drv.c
include/linux/hyperv.h
net/vmw_vsock/hyperv_transport.c