Commit acc44cbd authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg

wifi: cfg80211: avoid double free if updating BSS fails

cfg80211_update_known_bss will always consume the passed IEs. As such,
cfg80211_update_assoc_bss_entry also needs to always set the pointers to
NULL so that no double free can occur.

Note that hitting this would probably require being connected to a
hidden BSS which is then doing a channel switch while also switching to
be not hidden anymore at the same time.
Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231220133549.8891edb28d51.Id09c5145363e990ff5237decd58296302e2d53c8@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 31c5e92b
...@@ -3194,10 +3194,9 @@ void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev, ...@@ -3194,10 +3194,9 @@ void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev,
if (new) { if (new) {
/* to save time, update IEs for transmitting bss only */ /* to save time, update IEs for transmitting bss only */
if (cfg80211_update_known_bss(rdev, cbss, new, false)) { cfg80211_update_known_bss(rdev, cbss, new, false);
new->pub.proberesp_ies = NULL; new->pub.proberesp_ies = NULL;
new->pub.beacon_ies = NULL; new->pub.beacon_ies = NULL;
}
list_for_each_entry_safe(nontrans_bss, tmp, list_for_each_entry_safe(nontrans_bss, tmp,
&new->pub.nontrans_list, &new->pub.nontrans_list,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment