Skip to content

Commit aad1e81

Browse files
Arend Van Sprieljmberg-intel
authored andcommitted
nl80211: fix validation of scheduled scan info for wowlan netdetect
For wowlan netdetect a separate limit is defined for the number of matchsets. Currently, this limit is ignored and the regular limit for scheduled scan matchsets, ie. struct wiphy::max_match_sets, is used for the net-detect case as well. Cc: Johannes Berg <[email protected]> Reviewed-by: Hante Meuleman <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 66cd794 commit aad1e81

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/wireless/nl80211.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6912,7 +6912,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
69126912

69136913
static struct cfg80211_sched_scan_request *
69146914
nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
6915-
struct nlattr **attrs)
6915+
struct nlattr **attrs, int max_match_sets)
69166916
{
69176917
struct cfg80211_sched_scan_request *request;
69186918
struct nlattr *attr;
@@ -6977,7 +6977,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
69776977
if (!n_match_sets && default_match_rssi != NL80211_SCAN_RSSI_THOLD_OFF)
69786978
n_match_sets = 1;
69796979

6980-
if (n_match_sets > wiphy->max_match_sets)
6980+
if (n_match_sets > max_match_sets)
69816981
return ERR_PTR(-EINVAL);
69826982

69836983
if (attrs[NL80211_ATTR_IE])
@@ -7277,7 +7277,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
72777277
return -EINPROGRESS;
72787278

72797279
sched_scan_req = nl80211_parse_sched_scan(&rdev->wiphy, wdev,
7280-
info->attrs);
7280+
info->attrs,
7281+
rdev->wiphy.max_match_sets);
72817282

72827283
err = PTR_ERR_OR_ZERO(sched_scan_req);
72837284
if (err)
@@ -10089,7 +10090,8 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev,
1008910090
if (err)
1009010091
goto out;
1009110092

10092-
trig->nd_config = nl80211_parse_sched_scan(&rdev->wiphy, NULL, tb);
10093+
trig->nd_config = nl80211_parse_sched_scan(&rdev->wiphy, NULL, tb,
10094+
wowlan->max_nd_match_sets);
1009310095
err = PTR_ERR_OR_ZERO(trig->nd_config);
1009410096
if (err)
1009510097
trig->nd_config = NULL;

0 commit comments

Comments
 (0)