Skip to content

Commit 0941772

Browse files
committed
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: f7a8b10 ("wifi: cfg80211: fix 6 GHz scan request building") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 819bda5 commit 0941772

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

net/wireless/scan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3493,8 +3493,10 @@ int cfg80211_wext_siwscan(struct net_device *dev,
34933493
memcpy(creq->ssids[0].ssid, wreq->essid, wreq->essid_len);
34943494
creq->ssids[0].ssid_len = wreq->essid_len;
34953495
}
3496-
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE)
3496+
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE) {
3497+
creq->ssids = NULL;
34973498
creq->n_ssids = 0;
3499+
}
34983500
}
34993501

35003502
for (i = 0; i < NUM_NL80211_BANDS; i++)

0 commit comments

Comments
 (0)