diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2019-11-21 13:33:40 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-21 19:32:23 -0800 |
commit | 71f21959dd5516031db4f011e15e9a9508b93a7d (patch) | |
tree | 030210d478d7460d9edc2b854c7428cc63951092 /drivers/net/hyperv/hyperv_net.h | |
parent | 35fc59c95680afe958893f64e6b6f8ff69daf092 (diff) | |
download | linux-71f21959dd5516031db4f011e15e9a9508b93a7d.tar.bz2 |
hv_netvsc: Fix offset usage in netvsc_send_table()
To reach the data region, the existing code adds offset in struct
nvsp_5_send_indirect_table on the beginning of this struct. But the
offset should be based on the beginning of its container,
struct nvsp_message. This bug causes the first table entry missing,
and adds an extra zero from the zero pad after the data region.
This can put extra burden on the channel 0.
So, correct the offset usage. Also add a boundary check to ensure
not reading beyond data region.
Fixes: 5b54dac856cb ("hyperv: Add support for virtual Receive Side Scaling (vRSS)")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 670ef682f268..fb547f37af1e 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -609,7 +609,8 @@ struct nvsp_5_send_indirect_table { /* The number of entries in the send indirection table */ u32 count; - /* The offset of the send indirection table from top of this struct. + /* The offset of the send indirection table from the beginning of + * struct nvsp_message. * The send indirection table tells which channel to put the send * traffic on. Each entry is a channel number. */ |