Skip to content

Commit 5b7ae04

Browse files
dmantipovgregkh
authored andcommitted
wifi: cfg80211: fix use-after-free in cmp_bss()
[ Upstream commit 26e8444 ] Following bss_free() quirk introduced in commit 776b358 ("cfg80211: track hidden SSID networks properly"), adjust cfg80211_update_known_bss() to free the last beacon frame elements only if they're not shared via the corresponding 'hidden_beacon_bss' pointer. Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=30754ca335e6fb7e3092 Fixes: 3ab8227 ("cfg80211: refactor cfg80211_bss_update") Signed-off-by: Dmitry Antipov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 863443b commit 5b7ae04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/wireless/scan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,8 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
18681868
*/
18691869

18701870
f = rcu_access_pointer(new->pub.beacon_ies);
1871-
kfree_rcu((struct cfg80211_bss_ies *)f, rcu_head);
1871+
if (!new->pub.hidden_beacon_bss)
1872+
kfree_rcu((struct cfg80211_bss_ies *)f, rcu_head);
18721873
return false;
18731874
}
18741875

0 commit comments

Comments
 (0)