linux/drivers/net
jinyiting 83d686a682 bonding: 3ad: Fix the conflict between bond_update_slave_arr and the state machine
The bond works in mode 4, and performs down/up operations on the bond
that is normally negotiated. The probability of bond-> slave_arr is NULL

Test commands:
   ifconfig bond1 down
   ifconfig bond1 up

The conflict occurs in the following process:

__dev_open (CPU A)
--bond_open
  --queue_delayed_work(bond->wq,&bond->ad_work,0);
  --bond_update_slave_arr
    --bond_3ad_get_active_agg_info

ad_work(CPU B)
--bond_3ad_state_machine_handler
  --ad_agg_selection_logic

ad_work runs on cpu B. In the function ad_agg_selection_logic, all
agg->is_active will be cleared. Before the new active aggregator is
selected on CPU B, bond_3ad_get_active_agg_info failed on CPU A,
bond->slave_arr will be set to NULL. The best aggregator in
ad_agg_selection_logic has not changed, no need to update slave arr.

The conflict occurred in that ad_agg_selection_logic clears
agg->is_active under mode_lock, but bond_open -> bond_update_slave_arr
is inspecting agg->is_active outside the lock.

Also, bond_update_slave_arr is normal for potential sleep when
allocating memory, so replace the WARN_ON with a call to might_sleep.

Signed-off-by: jinyiting <jinyiting@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-21 14:42:19 -07:00
..
appletalk
arcnet net: arcnet: com20020 fix error handling 2021-03-14 14:17:48 -07:00
bonding bonding: 3ad: Fix the conflict between bond_update_slave_arr and the state machine 2021-04-21 14:42:19 -07:00
caif TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
can can: mcp251x: fix support for half duplex SPI host controllers 2021-04-06 12:31:21 +02:00
dsa net: phy: marvell: fix detection of PHY on Topaz switches 2021-04-12 14:20:19 -07:00
ethernet net: renesas: ravb: Fix a stuck issue when a lot of frames are received 2021-04-21 10:56:37 -07:00
fddi
fjes
hamradio module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
hippi
hyperv hv_netvsc: Fix validation in netvsc_linkstatus_callback() 2021-03-01 15:30:52 -08:00
ieee802154 drivers: net: fix memory leak in atusb_probe 2021-04-01 15:46:45 -07:00
ipa net: ipa: fix init header command validation 2021-03-20 18:53:41 -07:00
ipvlan
mdio net: mdio: Remove of_phy_attach() 2021-02-17 13:17:49 -08:00
mhi net: mhi: Add mbim proto 2021-02-10 15:11:51 -08:00
netdevsim netdevsim: init u64 stats for 32bit hardware 2021-03-04 14:36:26 -08:00
pcs
phy net: phy: intel-xway: enable integrated led functions 2021-04-21 10:59:17 -07:00
plip
ppp TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
slip
team
usb net: hso: fix null-ptr-deref during tty device unregistration 2021-04-07 15:18:15 -07:00
vmxnet3
wan drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit 2021-03-28 18:08:43 -07:00
wireguard wireguard: queueing: get rid of per-peer ring buffers 2021-02-23 15:59:34 -08:00
wireless iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() 2021-04-19 20:35:10 +03:00
xen-netback xen-netback: Check for hotplug-status existence before watching 2021-04-13 15:24:14 -07:00
bareudp.c
dummy.c
eql.c
geneve.c net: geneve: check skb is large enough for IPv4/IPv6 header 2021-04-11 16:54:57 -07:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-02-23 11:29:52 -08:00
ifb.c
Kconfig crypto: mips/poly1305 - enable for all MIPS processors 2021-03-08 11:52:17 +01:00
LICENSE.SRC
loopback.c Revert "net-loopback: set lo dev initial state to UP" 2021-02-11 13:10:44 -08:00
macsec.c
macvlan.c
macvtap.c
Makefile net: mhi: Add dedicated folder 2021-02-10 15:11:51 -08:00
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: fix dev_ifsioc_locked() race condition 2021-02-11 18:14:19 -08:00
thunderbolt.c
tun.c net: tun: set tun->dev->addr_len during TUNSETLINK processing 2021-04-06 16:52:21 -07:00
veth.c veth: Store queue_mapping independently of XDP prog presence 2021-03-06 00:04:52 +01:00
virtio_net.c virtio_net: Do not pull payload in skb->head 2021-04-06 16:17:57 -07:00
vrf.c vrf: fix a comment about loopback device 2021-04-14 13:13:53 -07:00
vsockmon.c
vxlan.c vxlan: do not modify the shared tunnel info when PMTU triggers an ICMP reply 2021-03-25 17:27:30 -07:00
xen-netfront.c