Skip to content

Commit eeff6f7

Browse files
pvts-matPlaidCat
authored andcommitted
cfg80211: hold bss_lock while updating nontrans_list
jira VULN-3807 cve-pre CVE-2022-42720 commit-author Rameshkumar Sundaram <quic_ramess@quicinc.com> commit a5199b5 Synchronize additions to nontrans_list of transmitting BSS with bss_lock to avoid races. Also when cfg80211_add_nontrans_list() fails __cfg80211_unlink_bss() needs bss_lock to be held (has lockdep assert on bss_lock). So protect the whole block with bss_lock to avoid races and warnings. Found during code review. Fixes: 0b8fb82 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com> Link: https://lore.kernel.org/r/1649668071-9370-1-git-send-email-quic_ramess@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> (cherry picked from commit a5199b5) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent 58ac554 commit eeff6f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/wireless/scan.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,11 +1982,13 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy,
19821982
/* this is a nontransmitting bss, we need to add it to
19831983
* transmitting bss' list if it is not there
19841984
*/
1985+
spin_lock_bh(&rdev->bss_lock);
19851986
if (cfg80211_add_nontrans_list(non_tx_data->tx_bss,
19861987
&res->pub)) {
19871988
if (__cfg80211_unlink_bss(rdev, res))
19881989
rdev->bss_generation++;
19891990
}
1991+
spin_unlock_bh(&rdev->bss_lock);
19901992
}
19911993

19921994
trace_cfg80211_return_bss(&res->pub);

0 commit comments

Comments
 (0)