]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.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)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 10 Jan 2017 17:41:53 +0000 (17:41 +0000)
commit62fe4ff99258504bd4c2bd95b848bab5065e4a81
tree31f621603b41b5ad6043d8411c41735d169f38a1
parent601d63a24e57ac4453496edf133a423fa4a7b7b4
cfg80211: limit scan results cache size

BugLink: http://bugs.launchpad.net/bugs/1650601
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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
net/wireless/core.h
net/wireless/scan.c