Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening
authorAndres Beltran <lkmlabelt@gmail.com>
Mon, 9 Nov 2020 10:04:00 +0000 (11:04 +0100)
committerWei Liu <wei.liu@kernel.org>
Tue, 17 Nov 2020 10:51:06 +0000 (10:51 +0000)
commite8b7db38449ac5b950a3f00519171c4be3e226ff
tree257903993b84723c09238c6963d022a9d857520f
parent09162bc32c880a791c6c0668ce0745cf7958f576
Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening

Currently, VMbus drivers use pointers into guest memory as request IDs
for interactions with Hyper-V. To be more robust in the face of errors
or malicious behavior from a compromised Hyper-V, avoid exposing
guest memory addresses to Hyper-V. Also avoid Hyper-V giving back a
bad request ID that is then treated as the address of a guest data
structure with no validation. Instead, encapsulate these memory
addresses and provide small integers as request IDs.

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>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/20201109100402.8946-2-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/channel.c
drivers/hv/hyperv_vmbus.h
drivers/hv/ring_buffer.c
include/linux/hyperv.h