hv_netvsc: Reset the RSC count if NVSP_STAT_FAIL in netvsc_receive()
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Wed, 3 Feb 2021 11:36:02 +0000 (12:36 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Feb 2021 02:59:17 +0000 (18:59 -0800)
commit12bc8dfb83b5292fe387b795210018b7632ee08b
treeb20a6e8e9699e56676973d3f769769c9dfca5d08
parent52cbd23a119c6ebf40a527e53f3402d2ea38eccb
hv_netvsc: Reset the RSC count if NVSP_STAT_FAIL in netvsc_receive()

Commit 44144185951a0f ("hv_netvsc: Add validation for untrusted Hyper-V
values") added validation to rndis_filter_receive_data() (and
rndis_filter_receive()) which introduced NVSP_STAT_FAIL-scenarios where
the count is not updated/reset.  Fix this omission, and prevent similar
scenarios from occurring in the future.

Reported-by: Juan Vazquez <juvazq@microsoft.com>
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Fixes: 44144185951a0f ("hv_netvsc: Add validation for untrusted Hyper-V values")
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Link: https://lore.kernel.org/r/20210203113602.558916-1-parri.andrea@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/rndis_filter.c