Skip to content

Commit 804809a

Browse files
committed
Johannes Berg says: ==================== Couple of fixes: - mac80211: - long-standing injection bug due to chanctx rework - more recent interface iteration issue - collect statistics before removing stations - hwsim: - fix NAN frequency typo (potential NULL ptr deref) - fix locking of radio lock (needs softirqs disabled) - wext: - ancient issue with compat and events copying some uninitialized stack data to userspace * tag 'wireless-2026-01-08' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: collect station statistics earlier when disconnect wifi: mac80211: restore non-chanctx injection behaviour wifi: mac80211_hwsim: disable BHs for hwsim_radio_lock wifi: mac80211: don't iterate not running interfaces wifi: mac80211_hwsim: fix typo in frequency notification wifi: avoid kernel-infoleak from struct iw_point ==================== Link: https://patch.msgid.link/20260108140141.139687-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 4d984b0 + a203dbe commit 804809a

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

drivers/net/wireless/virtual/mac80211_hwsim.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4040,7 +4040,7 @@ mac80211_hwsim_nan_dw_start(struct hrtimer *timer)
40404040
ieee80211_vif_to_wdev(data->nan_device_vif);
40414041

40424042
if (data->nan_curr_dw_band == NL80211_BAND_5GHZ)
4043-
ch = ieee80211_get_channel(hw->wiphy, 5475);
4043+
ch = ieee80211_get_channel(hw->wiphy, 5745);
40444044
else
40454045
ch = ieee80211_get_channel(hw->wiphy, 2437);
40464046

@@ -4112,14 +4112,14 @@ static int mac80211_hwsim_stop_nan(struct ieee80211_hw *hw,
41124112
hrtimer_cancel(&data->nan_timer);
41134113
data->nan_device_vif = NULL;
41144114

4115-
spin_lock(&hwsim_radio_lock);
4115+
spin_lock_bh(&hwsim_radio_lock);
41164116
list_for_each_entry(data2, &hwsim_radios, list) {
41174117
if (data2->nan_device_vif) {
41184118
nan_cluster_running = true;
41194119
break;
41204120
}
41214121
}
4122-
spin_unlock(&hwsim_radio_lock);
4122+
spin_unlock_bh(&hwsim_radio_lock);
41234123

41244124
if (!nan_cluster_running)
41254125
memset(hwsim_nan_cluster_id, 0, ETH_ALEN);

net/mac80211/chan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static void ieee80211_chanctx_user_iter_next(struct ieee80211_local *local,
9090
/* next (or first) interface */
9191
iter->sdata = list_prepare_entry(iter->sdata, &local->interfaces, list);
9292
list_for_each_entry_continue(iter->sdata, &local->interfaces, list) {
93+
if (!ieee80211_sdata_running(iter->sdata))
94+
continue;
95+
9396
/* AP_VLAN has a chanctx pointer but follows AP */
9497
if (iter->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
9598
continue;

net/mac80211/sta_info.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,10 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc)
15331533
}
15341534
}
15351535

1536+
sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1537+
if (sinfo)
1538+
sta_set_sinfo(sta, sinfo, true);
1539+
15361540
if (sta->uploaded) {
15371541
ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE,
15381542
IEEE80211_STA_NOTEXIST);
@@ -1541,9 +1545,6 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc)
15411545

15421546
sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);
15431547

1544-
sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1545-
if (sinfo)
1546-
sta_set_sinfo(sta, sinfo, true);
15471548
cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL);
15481549
kfree(sinfo);
15491550

net/mac80211/tx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,8 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
23972397

23982398
if (chanctx_conf)
23992399
chandef = &chanctx_conf->def;
2400+
else if (local->emulate_chanctx)
2401+
chandef = &local->hw.conf.chandef;
24002402
else
24012403
goto fail_rcu;
24022404

net/wireless/wext-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,10 @@ static int compat_standard_call(struct net_device *dev,
11011101
return ioctl_standard_call(dev, iwr, cmd, info, handler);
11021102

11031103
iwp_compat = (struct compat_iw_point *) &iwr->u.data;
1104+
1105+
/* struct iw_point has a 32bit hole on 64bit arches. */
1106+
memset(&iwp, 0, sizeof(iwp));
1107+
11041108
iwp.pointer = compat_ptr(iwp_compat->pointer);
11051109
iwp.length = iwp_compat->length;
11061110
iwp.flags = iwp_compat->flags;

net/wireless/wext-priv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ int compat_private_call(struct net_device *dev, struct iwreq *iwr,
228228
struct iw_point iwp;
229229

230230
iwp_compat = (struct compat_iw_point *) &iwr->u.data;
231+
232+
/* struct iw_point has a 32bit hole on 64bit arches. */
233+
memset(&iwp, 0, sizeof(iwp));
234+
231235
iwp.pointer = compat_ptr(iwp_compat->pointer);
232236
iwp.length = iwp_compat->length;
233237
iwp.flags = iwp_compat->flags;

0 commit comments

Comments
 (0)