Skip to content

Commit

Permalink
cfg80211: scan: drop entry from hidden_list on overflow
Browse files Browse the repository at this point in the history
commit 010bfbe upstream.

If we overflow the maximum number of BSS entries and free the
new entry, drop it from any hidden_list that it may have been
added to in the code above or in cfg80211_combine_bsses().

Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20210416094212.5de7d1676ad7.Ied283b0bc5f504845e7d6ab90626bdfa68bb3dc0@changeid
Cc: [email protected]
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jmberg-intel authored and gregkh committed May 22, 2021
1 parent 5ac24b3 commit f75374e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ cfg80211_bss_update(struct cfg80211_registered_device *rdev,

if (rdev->bss_entries >= bss_entries_limit &&
!cfg80211_bss_expire_oldest(rdev)) {
if (!list_empty(&new->hidden_list))
list_del(&new->hidden_list);
kfree(new);
goto drop;
}
Expand Down

0 comments on commit f75374e

Please sign in to comment.