mirror of
https://github.com/torvalds/linux.git
synced 2024-10-23 05:30:55 +00:00
wifi: cfg80211: wext: set ssids=NULL for passive scans
In nl80211, we always set the ssids of a scan request to
NULL when n_ssids==0 (passive scan). Drivers have relied
on this behaviour in the past, so we fixed it in 6 GHz
scan requests as well, and added a warning so we'd have
assurance the API would always be called that way.
syzbot found that wext doesn't ensure that, so we reach
the check and trigger the warning. Fix the wext code to
set the ssids pointer to NULL when there are none.
Reported-by: syzbot+cd6135193ba6bb9ad158@syzkaller.appspotmail.com
Fixes: f7a8b10bfd
("wifi: cfg80211: fix 6 GHz scan request building")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
819bda58e7
commit
0941772342
|
@ -3493,8 +3493,10 @@ int cfg80211_wext_siwscan(struct net_device *dev,
|
|||
memcpy(creq->ssids[0].ssid, wreq->essid, wreq->essid_len);
|
||||
creq->ssids[0].ssid_len = wreq->essid_len;
|
||||
}
|
||||
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE)
|
||||
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE) {
|
||||
creq->ssids = NULL;
|
||||
creq->n_ssids = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_NL80211_BANDS; i++)
|
||||
|
|
Loading…
Reference in New Issue
Block a user