]> git.baikalelectronics.ru Git - kernel.git/commit
vmxnet3: fix incorrect dereference when rxvlan is disabled
authorRonak Doshi <doshir@vmware.com>
Wed, 18 Apr 2018 19:48:04 +0000 (12:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Apr 2018 17:59:05 +0000 (13:59 -0400)
commit9d61d12e8d864d3f020b09c1a86b358d1bdea2e0
treed2735aa7d11a3b1032bed6d1e0d7137e31bbc3de
parentea436b152a2af544f352a825dbda1141e7488cb9
vmxnet3: fix incorrect dereference when rxvlan is disabled

vmxnet3_get_hdr_len() is used to calculate the header length which in
turn is used to calculate the gso_size for skb. When rxvlan offload is
disabled, vlan tag is present in the header and the function references
ip header from sizeof(ethhdr) and leads to incorrect pointer reference.

This patch fixes this issue by taking sizeof(vlan_ethhdr) into account
if vlan tag is present and correctly references the ip hdr.

Signed-off-by: Ronak Doshi <doshir@vmware.com>
Acked-by: Guolin Yang <gyang@vmware.com>
Acked-by: Louis Luo <llouis@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c
drivers/net/vmxnet3/vmxnet3_int.h