Frames from a known station are only passed to it if they were received on the channel of its link, see ieee80211_rx_valid_freq(). Frames without a matching station, such as beacons and peering frames of a new neighbour, are passed to every interface regardless of the channel they were received on. A mesh interface then creates stations for mesh points it hears on other channels and tries to peer with them. This happens on a wiphy with multiple radios, where every interface gets the frames of all radios, and can also happen while a wiphy scans. With mac80211_hwsim (multi_radio=1) and two wiphys, each with a mesh on 2412 and on 5180 MHz, every mesh interface ends up with an established peering to both interfaces of the other wiphy, as the peering frames reach the interface on the other band the same way. A ping over such a peering does not get through. mesh_matches_local() only accepts such a neighbour if the basic rates match, so a 2.4 GHz mesh is only affected towards 5 GHz if it does not use the 802.11b rates, which is common when legacy rates are disabled. Drop these frames on a joined mesh interface unless they were received on its channel. A mesh interface is never an MLD, so its deflink is the link to check. Other interface types are not changed, as they need to receive frames off-channel, e.g. for remain-on-channel. Signed-off-by: Florian Maurer --- Tested on wireless-next (e1dd848680) in qemu with mac80211_hwsim radios=3 multi_radio=1 regtest=5: mesh "test" with basic-rates 6,12,24 on 2412 and 5180 MHz on phy0 and phy1, and on 5240 MHz on phy2. Without the patch, each of the four interfaces on phy0/phy1 has two ESTAB peerings, one with each interface of the other wiphy. With it, each has only the peer on its own channel. Link-local pings on both bands: 20/20 before and after a CSA of the 5 GHz mesh from 5180 to 5200 MHz (iw dev ... switch freq 5200 beacons 5), the peerings stay ESTAB. No lockdep or RCU splats (PROVE_LOCKING, PROVE_RCU). Also built with CONFIG_MAC80211_MESH=n. The problem was seen on an mt7996 board (three radios on one wiphy) running a mesh on 2.4 and 5 GHz; this version was only tested with hwsim. net/mac80211/rx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index a2356cd176..d76833f41a 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -5606,6 +5606,12 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, /* No station, try to resolve the link and RX */ link = ieee80211_link_from_freq(sdata, status->freq); + /* a mesh only peers on its own channel, not via other radios */ + if (ieee80211_vif_is_mesh(&sdata->vif) && + sdata->u.mesh.mesh_id_len && + !ieee80211_rx_valid_freq(status, link)) + continue; + if (rx_data_pending) { ieee80211_prepare_and_rx_handle(&rx, skb, false); rx_data_pending = false; -- 2.39.5