[lkml]   [2017]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: mwifiex: correct channel stat buffer overflows
Brian Norris <> wrote:

> 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: <>
> Cc: Avinash Patil <>
> Cc: Xinming Hu <>
> Signed-off-by: Brian Norris <>
> Reviewed-by: Dmitry Torokhov <>
> Reviewed-by: Ganapathi Bhat <>

Patch applied to wireless-drivers-next.git, thanks.

4b5dde2d6234 mwifiex: correct channel stat buffer overflows


 \ /
  Last update: 2017-07-27 11:37    [W:0.047 / U:20.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site