linux/drivers/net
Mahesh Bandewar 17c8c59988 ipvlan: add L2 check for packets arriving via virtual devices
[ Upstream commit 92ff426450 ]

Packets that don't have dest mac as the mac of the master device should
not be entertained by the IPvlan rx-handler. This is mostly true as the
packet path mostly takes care of that, except when the master device is
a virtual device. As demonstrated in the following case -

  ip netns add ns1
  ip link add ve1 type veth peer name ve2
  ip link add link ve2 name iv1 type ipvlan mode l2
  ip link set dev iv1 netns ns1
  ip link set ve1 up
  ip link set ve2 up
  ip -n ns1 link set iv1 up
  ip addr add 192.168.10.1/24 dev ve1
  ip -n ns1 addr 192.168.10.2/24 dev iv1
  ping -c2 192.168.10.2
  <Works!>
  ip neigh show dev ve1
  ip neigh show 192.168.10.2 lladdr <random> dev ve1
  ping -c2 192.168.10.2
  <Still works! Wrong!!>

This patch adds that missing check in the IPvlan rx-handler.

Reported-by: Amit Sikka <amit.sikka@ericsson.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2018-03-19 08:42:56 +01:00
..
appletalk License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arcnet License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bonding bonding: fix slave stuck in BOND_LINK_FAIL state 2017-11-08 16:07:10 +09:00
caif License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
can can: flex_can: Correct the checking for frame length in flexcan_start_xmit() 2018-03-03 10:24:35 +01:00
cris License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa net: dsa: mv88e6xxx: Unregister MDIO bus on error path 2018-02-25 11:08:00 +01:00
ethernet bnxt_en: Don't print "Link speed -1 no longer supported" messages. 2018-03-19 08:42:53 +01:00
fddi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fjes networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hamradio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hippi hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close 2018-02-25 11:08:04 +01:00
hyperv hv_netvsc: fix send buffer failure on MTU change 2017-09-21 15:17:16 -07:00
ieee802154 net: ieee802154: adf7242: Fix bug if defined DEBUG 2018-03-19 08:42:49 +01:00
ipvlan ipvlan: add L2 check for packets arriving via virtual devices 2018-03-19 08:42:56 +01:00
phy net: phy: Restore phy_resume() locking assumption 2018-03-19 08:42:44 +01:00
plip net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
ppp ppp: prevent unregistered channels from connecting to PPP units 2018-03-08 22:41:10 -08:00
slip License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
team License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usb NET: usb: qmi_wwan: add support for YUGA CLM920-NC5 PID 0x9625 2018-03-03 10:24:33 +01:00
vmxnet3 vmxnet3: repair memory leak 2018-01-31 14:03:49 +01:00
wan hdlc_ppp: carrier detect ok, don't turn off negotiation 2018-03-08 22:41:08 -08:00
wimax License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wireless mac80211_hwsim: enforce PS_MANUAL_POLL to be set after PS_ENABLED 2018-03-19 08:42:55 +01:00
xen-netback xen-netfront, xen-netback: Use correct minimum MTU values 2017-10-16 16:00:44 -04:00
dummy.c dummy: Remove references to NETIF_F_UFO. 2017-07-17 09:52:57 -07:00
eql.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
geneve.c geneve: fix fill_info when link down 2017-12-14 09:53:11 +01:00
gtp.c gtp: Initialize 64-bit per-cpu stats correctly 2017-08-01 20:06:07 -07:00
ifb.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
Kconfig x86/lguest: Remove lguest support 2017-08-24 09:57:28 +02:00
LICENSE.SRC Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
loopback.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
macsec.c macsec: fix memory leaks when skb_to_sgvec fails 2017-10-11 14:07:20 -07:00
macvlan.c macvlan: Fix one possible double free 2018-03-03 10:24:33 +01:00
macvtap.c tap: reference to KVA of an unloaded module causes kernel panic 2017-10-28 19:17:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mdio.c net: mdio: add mdio45_ethtool_ksettings_get 2017-01-02 16:59:10 -05:00
mii.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
netconsole.c netconsole: Remove duplicate "netconsole: " logging prefix 2017-06-13 12:57:40 -04:00
nlmon.c net: add netlink_ext_ack argument to rtnl_link_ops.validate 2017-06-26 23:13:22 -04:00
ntb_netdev.c ntb_netdev: set the net_device's parent 2017-07-06 11:30:08 -04:00
rionet.c net: convert sk_buff.users from atomic_t to refcount_t 2017-07-01 07:39:07 -07:00
sb1000.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
Space.c net: Fix coding style warnings and errors. 2016-05-19 11:48:27 -07:00
sungem_phy.c drivers/net/sungem: add const to mii_phy_ops structures 2017-06-08 15:32:47 -04:00
tap.c net: accept UFO datagrams from tuntap and packet 2017-12-17 15:07:58 +01:00
tun.c tuntap: disable preemption during XDP processing 2018-03-08 22:41:18 -08:00
veth.c veth: set peer GSO values 2018-03-19 08:42:54 +01:00
virtio_net.c virtio_net: Disable interrupts if napi_complete_done rescheduled napi 2018-03-19 08:42:54 +01:00
vrf.c net: vrf: Add support for sends to local broadcast address 2018-01-31 14:03:45 +01:00
vsockmon.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
vxlan.c vxlan: update skb dst pmtu on tx path 2018-03-03 10:24:26 +01:00
xen-netfront.c xen-netfront: enable device after manual module load 2018-03-03 10:24:36 +01:00