Skip to content

Commit 7b05797

Browse files
jmberg-intelgregkh
authored andcommitted
wifi: cfg80211: wext: set ssids=NULL for passive scans
commit 0941772 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 37c36c8 commit 7b05797

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
@@ -3492,8 +3492,10 @@ int cfg80211_wext_siwscan(struct net_device *dev,
34923492
memcpy(creq->ssids[0].ssid, wreq->essid, wreq->essid_len);
34933493
creq->ssids[0].ssid_len = wreq->essid_len;
34943494
}
3495-
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE)
3495+
if (wreq->scan_type == IW_SCAN_TYPE_PASSIVE) {
3496+
creq->ssids = NULL;
34963497
creq->n_ssids = 0;
3498+
}
34973499
}
34983500

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

0 commit comments

Comments
 (0)