aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-record
diff options
context:
space:
mode:
authorBrian Norris <[email protected]>2017-06-29 18:23:54 -0700
committerKalle Valo <[email protected]>2017-07-27 12:35:55 +0300
commit4b5dde2d6234ff5bc68e97e6901d1f2a0a7f3749 (patch)
treecfb57a7b4056674a6d75476f5b9344afadc2b5f4 /tools/perf/scripts/python/bin/stackcollapse-record
parent53d56f79a0b2e4bc5bbc04988e5bfde768db604f (diff)
mwifiex: correct channel stat buffer overflows
mwifiex records information about various channels as it receives scan information. It does this by appending to a buffer that was sized to the max number of supported channels on any band, but there are numerous problems: (a) scans can return info from more than one band (e.g., both 2.4 and 5 GHz), so the determined "max" is not large enough (b) some firmware appears to return multiple results for a given channel, so the max *really* isn't large enough (c) there is no bounds checking when stashing these stats, so problems (a) and (b) can easily lead to buffer overflows Let's patch this by setting a slightly-more-correct max (that accounts for a combination of both 2.4G and 5G bands) and adding a bounds check when writing to our statistics buffer. Due to problem (b), we still might not properly report all known survey information (e.g., with "iw <dev> survey dump"), since duplicate results (or otherwise "larger than expected" results) will cause some truncation. But that's a problem for a future bugfix. (And because of this known deficiency, only log the excess at the WARN level, since that isn't visible by default in this driver and would otherwise be a bit too noisy.) Fixes: bf35443314ac ("mwifiex: channel statistics support for mwifiex") Cc: <[email protected]> Cc: Avinash Patil <[email protected]> Cc: Xinming Hu <[email protected]> Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Dmitry Torokhov <[email protected]> Reviewed-by: Ganapathi Bhat <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions