• Haiyang Zhang's avatar
    hv_netvsc: Fix offset usage in netvsc_send_table() · 71f21959
    Haiyang Zhang authored
    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: 5b54dac8 ("hyperv: Add support for virtual Receive Side Scaling (vRSS)")
    Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    71f21959
hyperv_net.h 39.6 KB