mirror-linux/drivers/net
Vlad Buslov ca56cdfab3 macvlan: Don't propagate promisc change to lower dev in passthru
[ Upstream commit 7e1caeace0 ]

Macvlan device in passthru mode sets its lower device promiscuous mode
according to its MACVLAN_FLAG_NOPROMISC flag instead of synchronizing it to
its own promiscuity setting. However, macvlan_change_rx_flags() function
doesn't check the mode before propagating such changes to the lower device
which can cause net_device->promiscuity counter overflow as illustrated by
reproduction example [0] and resulting dmesg log [1]. Fix the issue by
first verifying the mode in macvlan_change_rx_flags() function before
propagating promiscuous mode change to the lower device.

[0]:
ip link add macvlan1 link enp8s0f0 type macvlan mode passthru
ip link set macvlan1 promisc on
ip l set dev macvlan1 up
ip link set macvlan1 promisc off
ip l set dev macvlan1 down
ip l set dev macvlan1 up

[1]:
[ 5156.281724] macvlan1: entered promiscuous mode
[ 5156.285467] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
[ 5156.287639] macvlan1: left promiscuous mode
[ 5156.288339] mlx5_core 0000:08:00.0 enp8s0f0: left promiscuous mode
[ 5156.290907] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
[ 5156.317197] mlx5_core 0000:08:00.0 enp8s0f0: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken.

Fixes: efdbd2b30c ("macvlan: Propagate promiscuity setting to lower devices.")
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231114175915.1649154-1-vladbu@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:07:06 +00:00
..
appletalk
arcnet
bonding bonding: stop the device in bond_setup_by_slave() 2023-11-28 17:07:05 +00:00
caif
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:51:53 +01:00
dsa net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() 2023-10-25 12:03:07 +02:00
ethernet net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors 2023-11-28 17:07:06 +00:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-02 09:35:27 +01:00
ipa
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 17:07:04 +00:00
mctp
mdio
netdevsim
pcs
phy net: phy: bcm7xxx: Add missing 16nm EPHY statistics 2023-10-25 12:03:08 +02:00
plip
ppp ppp: limit MRU to 64K 2023-11-28 17:07:05 +00:00
pse-pd
slip
team
usb r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() 2023-11-08 14:11:02 +01:00
vmxnet3
vxlan neighbour: annotate lockless accesses to n->nud_state 2023-10-10 22:00:42 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 22:00:40 +02:00
wireguard
wireless wifi: iwlwifi: Use FW rate for non-data frames 2023-11-28 17:07:03 +00:00
wwan
xen-netback xen-netback: use default TX queue size for vifs 2023-10-19 23:08:53 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: fix fragmentation needed check with gso 2023-11-02 09:35:28 +01:00
ifb.c
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:51:55 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 17:07:06 +00:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: prevent negative ifindex 2023-10-25 12:03:06 +02:00
veth.c
virtio_net.c
vrf.c vrf: Fix lockdep splat in output path 2023-10-10 22:00:46 +02:00
vsockmon.c
xen-netfront.c