Skip to content

Commit 2697c45

Browse files
committed
Johannes Berg says: ==================== Some more fixes: - mt76 gets three almost identical new length checks - cw1200 & ti: locking fixes - mac80211 has a fix for the recent EML frame handling - rsi driver no longer oddly responds to config, which had triggered a warning in mac80211 - ath12k has two fixes for station statistics handling * tag 'wireless-2026-03-04' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211() wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211() wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211() wifi: wlcore: Fix a locking bug wifi: cw1200: Fix locking in error paths wifi: mac80211: fix missing ieee80211_eml_params member initialization wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config wifi: ath12k: fix station lookup failure when disconnecting from AP wifi: ath12k: use correct pdev id when requesting firmware stats ==================== Link: https://patch.msgid.link/20260304112500.169639-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 126fe7e + 4e10a73 commit 2697c45

9 files changed

Lines changed: 25 additions & 29 deletions

File tree

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5430,7 +5430,7 @@ int ath12k_mac_op_get_txpower(struct ieee80211_hw *hw,
54305430
ar->last_tx_power_update))
54315431
goto send_tx_power;
54325432

5433-
params.pdev_id = ar->pdev->pdev_id;
5433+
params.pdev_id = ath12k_mac_get_target_pdev_id(ar);
54345434
params.vdev_id = arvif->vdev_id;
54355435
params.stats_id = WMI_REQUEST_PDEV_STAT;
54365436
ret = ath12k_mac_get_fw_stats(ar, &params);
@@ -13452,7 +13452,7 @@ void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
1345213452
/* TODO: Use real NF instead of default one. */
1345313453
signal = rate_info.rssi_comb;
1345413454

13455-
params.pdev_id = ar->pdev->pdev_id;
13455+
params.pdev_id = ath12k_mac_get_target_pdev_id(ar);
1345613456
params.vdev_id = 0;
1345713457
params.stats_id = WMI_REQUEST_VDEV_STAT;
1345813458

@@ -13580,7 +13580,7 @@ void ath12k_mac_op_link_sta_statistics(struct ieee80211_hw *hw,
1358013580
spin_unlock_bh(&ar->ab->dp->dp_lock);
1358113581

1358213582
if (!signal && ahsta->ahvif->vdev_type == WMI_VDEV_TYPE_STA) {
13583-
params.pdev_id = ar->pdev->pdev_id;
13583+
params.pdev_id = ath12k_mac_get_target_pdev_id(ar);
1358413584
params.vdev_id = 0;
1358513585
params.stats_id = WMI_REQUEST_VDEV_STAT;
1358613586

drivers/net/wireless/ath/ath12k/wmi.c

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8241,8 +8241,6 @@ static int ath12k_wmi_tlv_fw_stats_data_parse(struct ath12k_base *ab,
82418241
struct ath12k_fw_stats *stats = parse->stats;
82428242
struct ath12k *ar;
82438243
struct ath12k_link_vif *arvif;
8244-
struct ieee80211_sta *sta;
8245-
struct ath12k_sta *ahsta;
82468244
struct ath12k_link_sta *arsta;
82478245
int i, ret = 0;
82488246
const void *data = ptr;
@@ -8278,21 +8276,19 @@ static int ath12k_wmi_tlv_fw_stats_data_parse(struct ath12k_base *ab,
82788276

82798277
arvif = ath12k_mac_get_arvif(ar, le32_to_cpu(src->vdev_id));
82808278
if (arvif) {
8281-
sta = ieee80211_find_sta_by_ifaddr(ath12k_ar_to_hw(ar),
8282-
arvif->bssid,
8283-
NULL);
8284-
if (sta) {
8285-
ahsta = ath12k_sta_to_ahsta(sta);
8286-
arsta = &ahsta->deflink;
8279+
spin_lock_bh(&ab->base_lock);
8280+
arsta = ath12k_link_sta_find_by_addr(ab, arvif->bssid);
8281+
if (arsta) {
82878282
arsta->rssi_beacon = le32_to_cpu(src->beacon_snr);
82888283
ath12k_dbg(ab, ATH12K_DBG_WMI,
82898284
"wmi stats vdev id %d snr %d\n",
82908285
src->vdev_id, src->beacon_snr);
82918286
} else {
8292-
ath12k_dbg(ab, ATH12K_DBG_WMI,
8293-
"not found station bssid %pM for vdev stat\n",
8294-
arvif->bssid);
8287+
ath12k_warn(ab,
8288+
"not found link sta with bssid %pM for vdev stat\n",
8289+
arvif->bssid);
82958290
}
8291+
spin_unlock_bh(&ab->base_lock);
82968292
}
82978293

82988294
data += sizeof(*src);
@@ -8363,8 +8359,6 @@ static int ath12k_wmi_tlv_rssi_chain_parse(struct ath12k_base *ab,
83638359
struct ath12k_fw_stats *stats = parse->stats;
83648360
struct ath12k_link_vif *arvif;
83658361
struct ath12k_link_sta *arsta;
8366-
struct ieee80211_sta *sta;
8367-
struct ath12k_sta *ahsta;
83688362
struct ath12k *ar;
83698363
int vdev_id;
83708364
int j;
@@ -8400,19 +8394,15 @@ static int ath12k_wmi_tlv_rssi_chain_parse(struct ath12k_base *ab,
84008394
"stats bssid %pM vif %p\n",
84018395
arvif->bssid, arvif->ahvif->vif);
84028396

8403-
sta = ieee80211_find_sta_by_ifaddr(ath12k_ar_to_hw(ar),
8404-
arvif->bssid,
8405-
NULL);
8406-
if (!sta) {
8407-
ath12k_dbg(ab, ATH12K_DBG_WMI,
8408-
"not found station of bssid %pM for rssi chain\n",
8409-
arvif->bssid);
8397+
guard(spinlock_bh)(&ab->base_lock);
8398+
arsta = ath12k_link_sta_find_by_addr(ab, arvif->bssid);
8399+
if (!arsta) {
8400+
ath12k_warn(ab,
8401+
"not found link sta with bssid %pM for rssi chain\n",
8402+
arvif->bssid);
84108403
return -EPROTO;
84118404
}
84128405

8413-
ahsta = ath12k_sta_to_ahsta(sta);
8414-
arsta = &ahsta->deflink;
8415-
84168406
BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) >
84178407
ARRAY_SIZE(stats_rssi->rssi_avg_beacon));
84188408

drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
413413
u32 val;
414414

415415
if (ieee80211_is_action(fc) &&
416+
skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 + 1 + 2 &&
416417
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
417418
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
418419
u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);

drivers/net/wireless/mediatek/mt76/mt7925/mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ mt7925_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
668668
u32 val;
669669

670670
if (ieee80211_is_action(fc) &&
671+
skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
671672
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
672673
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ)
673674
tid = MT_TX_ADDBA;

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi,
800800
u32 val;
801801

802802
if (ieee80211_is_action(fc) &&
803+
skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
803804
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
804805
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
805806
if (is_mt7990(&dev->mt76))

drivers/net/wireless/rsi/rsi_91x_mac80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
668668
struct rsi_hw *adapter = hw->priv;
669669
struct rsi_common *common = adapter->priv;
670670
struct ieee80211_conf *conf = &hw->conf;
671-
int status = -EOPNOTSUPP;
671+
int status = 0;
672672

673673
mutex_lock(&common->mutex);
674674

drivers/net/wireless/st/cw1200/pm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,14 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
264264
wiphy_err(priv->hw->wiphy,
265265
"PM request failed: %d. WoW is disabled.\n", ret);
266266
cw1200_wow_resume(hw);
267+
mutex_unlock(&priv->conf_mutex);
267268
return -EBUSY;
268269
}
269270

270271
/* Force resume if event is coming from the device. */
271272
if (atomic_read(&priv->bh_rx)) {
272273
cw1200_wow_resume(hw);
274+
mutex_unlock(&priv->conf_mutex);
273275
return -EAGAIN;
274276
}
275277

drivers/net/wireless/ti/wlcore/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,8 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
18751875
wl->wow_enabled);
18761876
WARN_ON(!wl->wow_enabled);
18771877

1878+
mutex_lock(&wl->mutex);
1879+
18781880
ret = pm_runtime_force_resume(wl->dev);
18791881
if (ret < 0) {
18801882
wl1271_error("ELP wakeup failure!");
@@ -1891,8 +1893,6 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
18911893
run_irq_work = true;
18921894
spin_unlock_irqrestore(&wl->wl_lock, flags);
18931895

1894-
mutex_lock(&wl->mutex);
1895-
18961896
/* test the recovery flag before calling any SDIO functions */
18971897
pending_recovery = test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS,
18981898
&wl->flags);

net/mac80211/eht.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ void ieee80211_rx_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata,
154154
u8 *ptr = mgmt->u.action.u.eml_omn.variable;
155155
struct ieee80211_eml_params eml_params = {
156156
.link_id = status->link_id,
157+
.control = control,
157158
};
158159
struct sta_info *sta;
159160
int opt_len = 0;

0 commit comments

Comments
 (0)