hv_netvsc: Add (more) validation for untrusted Hyper-V values
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Thu, 14 Jan 2021 20:26:28 +0000 (21:26 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jan 2021 03:47:47 +0000 (19:47 -0800)
commit505e3f00c3f3648cb6260deb35e87fae1f64f5d8
tree7dd0f2939b234775da7bc5973fc633ba6a6ae757
parenta98c0c47420412ef94d6f45f9ae607258929aa10
hv_netvsc: Add (more) 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.  Ensure that invalid values cannot cause indexing
off the end of an array, or subvert an existing validation via integer
overflow.  Ensure that outgoing packets do not have any leftover guest
memory that has not been zeroed out.

Reported-by: Juan Vazquez <juvazq@microsoft.com>
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20210114202628.119541-1-parri.andrea@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_bpf.c
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c