]> 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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:37 +0000 (03:54 +0000)
commita78748b4a770a1dfab81802496fdec8f1195585f
tree9ea15b34d9864ab3fb97733b1a39b94319f04ecc
parentb2486d4f0e95783651f3d390cf03eb5331949ae7
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: Ben Hutchings <ben@decadent.org.uk>
net/wireless/core.h
net/wireless/scan.c