aboutsummaryrefslogtreecommitdiff
path: root/net/wireless/core.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-11-15 12:05:11 +0100
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:58:47 +0200
commitb2a74f74511993e55dfac4e2459ff54d52af0e89 (patch)
tree93162b4d9cec302a3c17b2346fba4d6c7e44f068 /net/wireless/core.h
parent704513cd0e616989c188a8eca8920930df3c125c (diff)
downloadandroid_kernel_m2note-b2a74f74511993e55dfac4e2459ff54d52af0e89.tar.gz
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>
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r--net/wireless/core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 15b4bb7ac..45af05481 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -69,6 +69,7 @@ struct cfg80211_registered_device {
struct list_head bss_list;
struct rb_root bss_tree;
u32 bss_generation;
+ u32 bss_entries;
struct cfg80211_scan_request *scan_req; /* protected by RTNL */
struct cfg80211_sched_scan_request *sched_scan_req;
unsigned long suspend_at;