linux-stable/drivers/net
Eyal Birger 13bcc6f8ef vrf: fix packet sniffing for traffic originating from ip tunnels
[ Upstream commit 012d69fbfc ]

in commit 0489390882
("vrf: add mac header for tunneled packets when sniffer is attached")
an Ethernet header was cooked for traffic originating from tunnel devices.

However, the header is added based on whether the mac_header is unset
and ignores cases where the device doesn't expose a mac header to upper
layers, such as in ip tunnels like ipip and gre.

Traffic originating from such devices still appears garbled when capturing
on the vrf device.

Fix by observing whether the original device exposes a header to upper
layers, similar to the logic done in af_packet.

In addition, skb->mac_len needs to be adjusted after adding the Ethernet
header for the skb_push/pull() surrounding dev_queue_xmit_nit() to work
on these packets.

Fixes: 0489390882 ("vrf: add mac header for tunneled packets when sniffer is attached")
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-13 20:59:15 +02:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:12:46 +01:00
bonding bonding: fix data-races around agg_select_timer 2022-02-23 12:03:12 +01:00
caif
can can: etas_es58x: es58x_fd_rx_event_msg(): initialize rx_event_msg before calling es58x_check_msg_len() 2022-04-13 20:59:08 +02:00
dsa net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator 2022-04-08 14:23:54 +02:00
ethernet net: sfc: add missing xdp queue reinitialization 2022-04-13 20:59:15 +02:00
fddi
fjes
hamradio drivers: hamradio: 6pack: fix UAF bug caused by mod_timer() 2022-04-08 14:22:59 +02:00
hippi
hyperv hv_netvsc: Add check for kvmalloc_array 2022-03-23 09:16:42 +01:00
ieee802154 net: ieee802154: ca8210: Fix lifs/sifs periods 2022-02-23 12:03:11 +01:00
ipa net: ipa: add an interconnect dependency 2022-03-08 19:12:45 +01:00
ipvlan
mctp
mdio net: mdio-ipq4019: add delay after clock enable 2022-03-02 11:47:58 +01:00
netdevsim ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt 2022-02-23 12:03:10 +01:00
pcs
phy net: sfp: add 2500base-X quirk for Lantech SFP module 2022-04-13 20:59:09 +02:00
plip
ppp
slip slip: fix macro redefine warning 2022-03-11 12:22:31 +01:00
team
usb net: asix: add proper error handling of usb read errors 2022-04-08 14:23:29 +02:00
vmxnet3
wan
wireguard wireguard: socket: ignore v6 endpoints when ipv6 is disabled 2022-04-08 14:24:09 +02:00
wireless mt76: fix monitor mode crash with sdio driver 2022-04-13 20:59:09 +02:00
wwan
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-03-16 14:23:41 +01:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-04-08 14:23:41 +02:00
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c macvtap: advertise link netns via netlink 2022-04-13 20:59:07 +02:00
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 20:59:07 +02:00
thunderbolt.c
tun.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 20:59:07 +02:00
veth.c
virtio_net.c
vrf.c vrf: fix packet sniffing for traffic originating from ip tunnels 2022-04-13 20:59:15 +02:00
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: react properly to failing gnttab_end_foreign_access_ref() 2022-03-11 12:22:37 +01:00