]> 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)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:56 +0000 (11:03 +0100)
commit98db9446275f9354e1521c0790ea6bf5b0eecfab
tree70cf85073e46e41ac88bb3924b3ce652314ef64b
parentf862950df36a3ad2c389270932b51bf2fca26e6d
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: Willy Tarreau <w@1wt.eu>
net/wireless/core.h
net/wireless/scan.c