WSL2-Linux-Kernel/drivers/net
Vlad Buslov 5bcce23f38 macvlan: Don't propagate promisc change to lower dev in passthru
[ Upstream commit 7e1caeace0418381f36b3aa8403dfd82fc57fc53 ]

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 16:56:25 +00:00
..
appletalk
arcnet net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-09-19 12:22:34 +02:00
bonding bonding: stop the device in bond_setup_by_slave() 2023-11-28 16:56:23 +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:08:15 +01:00
dsa net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() 2023-10-25 11:58:57 +02:00
ethernet net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors 2023-11-28 16:56:25 +00:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-08 17:26:38 +01:00
ipa
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 16:56:22 +00:00
mctp
mdio net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe() 2023-05-24 17:36:41 +01:00
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-23 13:47:45 +02:00
pcs
phy net: phy: mscc: macsec: reject PN update requests 2023-10-19 23:05:34 +02:00
plip
ppp ppp: limit MRU to 64K 2023-11-28 16:56:23 +00:00
slip
team team: fix null-ptr-deref when team device type is changed 2023-10-06 13:18:08 +02:00
usb r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() 2023-11-08 17:26:48 +01:00
vmxnet3
vxlan vxlan: generalize vxlan_parse_gpe_hdr and remove unused args 2023-09-19 12:22:27 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 21:59:06 +02:00
wireguard wireguard: allowedips: expand maximum node depth 2023-08-16 18:21:57 +02:00
wireless wifi: iwlwifi: Use FW rate for non-data frames 2023-11-28 16:56:21 +00:00
wwan
xen-netback xen-netback: use default TX queue size for vifs 2023-10-19 23:05:34 +02:00
Kconfig
LICENSE.SRC
Makefile vxlan: move to its own directory 2023-08-03 10:22:34 +02:00
Space.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: fix fragmentation needed check with gso 2023-11-08 17:26:39 +01:00
ifb.c
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:08:16 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 16:56:25 +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 net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 15:13:57 +02:00
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 13:18:23 +02:00
tun.c tun: prevent negative ifindex 2023-10-25 11:58:57 +02:00
veth.c veth: Fixing transmit return status for dropped packets 2023-09-19 12:22:58 +02:00
virtio_net.c virtio-net: set queues after driver_ok 2023-08-26 14:23:38 +02:00
vrf.c
vsockmon.c
xen-netfront.c