hv_utils: Add validation for untrusted Hyper-V values
authorAndres Beltran <lkmlabelt@gmail.com>
Mon, 9 Nov 2020 10:07:04 +0000 (11:07 +0100)
committerWei Liu <wei.liu@kernel.org>
Fri, 5 Feb 2021 09:55:42 +0000 (09:55 +0000)
commit06caa778d8b2fbcb4ac3878751e39d116424ba9b
treef000d7887567b34e15a3193cf831589c5365c838
parenta8c3209998afb5c4941b49e35b513cea9050cb4a
hv_utils: Add validation for untrusted Hyper-V values

For additional robustness in the face of Hyper-V errors or malicious
behavior, validate all values that originate from packets that Hyper-V
has sent to the guest in the host-to-guest ring buffer. Ensure that
invalid values cannot cause indexing off the end of the icversion_data
array in vmbus_prep_negotiate_resp().

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/20201109100704.9152-1-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/channel_mgmt.c
drivers/hv/hv_fcopy.c
drivers/hv/hv_kvp.c
drivers/hv/hv_snapshot.c
drivers/hv/hv_util.c
include/linux/hyperv.h