]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cfg80211: limit scan results cache size
authorJohannes Berg <johannes.berg@intel.com>
Tue, 15 Nov 2016 11:05:11 +0000 (12:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2016 08:10:31 +0000 (09:10 +0100)
commit9c15a98542f06aefa58fbbbe3ee02f226948f3bb
tree0cd7f2e82af703cdf1174113d3d31a1f7b48c1f2
parentf204d21ee0b7ecedcb50c33c4f2ff52b6e5b1455
cfg80211: limit scan results cache size

commit 9853a55ef1bb66d7411136046060bbfb69c714fa upstream.

It's possible to make scanning consume almost arbitrary amounts
of memory, e.g. by sending beacon frames with random BSSIDs at
high rates while somebody is scanning.

Limit the number of BSS table entries we're willing to cache to
1000, limiting maximum memory usage to maybe 4-5MB, but lower
in practice - that would be the case for having both full-sized
beacon and probe response frames for each entry; this seems not
possible in practice, so a limit of 1000 entries will likely be
closer to 0.5 MB.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/core.h
net/wireless/scan.c