Skip to content

Commit 00d6709

Browse files
committed
Merge tag 'wireless-2023-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
Johannes Berg says: ==================== Three more fixes: - don't drop all unprotected public action frames since some don't have a protected dual - fix pointer confusion in scanning code - fix warning in some connections with multiple links * tag 'wireless-2023-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: don't drop all unprotected public action frames wifi: cfg80211: fix assoc response warning on failed links wifi: cfg80211: pass correct pointer to rdev_inform_bss() ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents cd8892c + 9153561 commit 00d6709

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

include/linux/ieee80211.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,6 +4355,35 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
43554355
return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
43564356
}
43574357

4358+
/**
4359+
* ieee80211_is_protected_dual_of_public_action - check if skb contains a
4360+
* protected dual of public action management frame
4361+
* @skb: the skb containing the frame, length will be checked
4362+
*
4363+
* Return: true if the skb contains a protected dual of public action
4364+
* management frame, false otherwise.
4365+
*/
4366+
static inline bool
4367+
ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb)
4368+
{
4369+
u8 action;
4370+
4371+
if (!ieee80211_is_public_action((void *)skb->data, skb->len) ||
4372+
skb->len < IEEE80211_MIN_ACTION_SIZE + 1)
4373+
return false;
4374+
4375+
action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE);
4376+
4377+
return action != WLAN_PUB_ACTION_20_40_BSS_COEX &&
4378+
action != WLAN_PUB_ACTION_DSE_REG_LOC_ANN &&
4379+
action != WLAN_PUB_ACTION_MSMT_PILOT &&
4380+
action != WLAN_PUB_ACTION_TDLS_DISCOVER_RES &&
4381+
action != WLAN_PUB_ACTION_LOC_TRACK_NOTI &&
4382+
action != WLAN_PUB_ACTION_FTM_REQUEST &&
4383+
action != WLAN_PUB_ACTION_FTM_RESPONSE &&
4384+
action != WLAN_PUB_ACTION_FILS_DISCOVERY;
4385+
}
4386+
43584387
/**
43594388
* _ieee80211_is_group_privacy_action - check if frame is a group addressed
43604389
* privacy action frame

net/mac80211/rx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,8 +2468,7 @@ static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
24682468

24692469
/* drop unicast public action frames when using MPF */
24702470
if (is_unicast_ether_addr(mgmt->da) &&
2471-
ieee80211_is_public_action((void *)rx->skb->data,
2472-
rx->skb->len))
2471+
ieee80211_is_protected_dual_of_public_action(rx->skb))
24732472
return -EACCES;
24742473
}
24752474

net/wireless/mlme.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ void cfg80211_rx_assoc_resp(struct net_device *dev,
4343

4444
for (link_id = 0; link_id < ARRAY_SIZE(data->links); link_id++) {
4545
cr.links[link_id].status = data->links[link_id].status;
46+
cr.links[link_id].bss = data->links[link_id].bss;
47+
4648
WARN_ON_ONCE(cr.links[link_id].status != WLAN_STATUS_SUCCESS &&
4749
(!cr.ap_mld_addr || !cr.links[link_id].bss));
4850

49-
cr.links[link_id].bss = data->links[link_id].bss;
5051
if (!cr.links[link_id].bss)
5152
continue;
5253
cr.links[link_id].bssid = data->links[link_id].bss->bssid;

net/wireless/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy,
21252125
if (!res)
21262126
goto drop;
21272127

2128-
rdev_inform_bss(rdev, &res->pub, ies, data->drv_data);
2128+
rdev_inform_bss(rdev, &res->pub, ies, drv_data->drv_data);
21292129

21302130
if (data->bss_source == BSS_SOURCE_MBSSID) {
21312131
/* this is a nontransmitting bss, we need to add it to

0 commit comments

Comments
 (0)