From: Kalle Valo <kvalo@codeaurora.org>
To: Brian Norris <briannorris@chromium.org>
Cc: Ganapathi Bhat <gbhat@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>,
<linux-kernel@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Amitkumar Karwar <amitkarwar@gmail.com>,
linux-wireless@vger.kernel.org,
Brian Norris <briannorris@chromium.org>,
stable@vger.kernel.org, Avinash Patil <patila@marvell.com>,
Xinming Hu <huxm@marvell.com>
Subject: Re: mwifiex: correct channel stat buffer overflows
Date: Thu, 27 Jul 2017 09:36:24 +0000 (UTC) [thread overview]
Message-ID: <20170727093624.061F96095E@smtp.codeaurora.org> (raw)
In-Reply-To: <20170630012354.98931-1-briannorris@chromium.org>
Brian Norris <briannorris@chromium.org> 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: <stable@vger.kernel.org>
> Cc: Avinash Patil <patila@marvell.com>
> Cc: Xinming Hu <huxm@marvell.com>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Reviewed-by: Ganapathi Bhat <gbhat@marvell.com>
Patch applied to wireless-drivers-next.git, thanks.
4b5dde2d6234 mwifiex: correct channel stat buffer overflows
--
https://patchwork.kernel.org/patch/9818269/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2017-07-27 9:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 1:23 [PATCH] mwifiex: correct channel stat buffer overflows Brian Norris
2017-06-30 18:04 ` Dmitry Torokhov
2017-06-30 18:13 ` [EXT] " Ganapathi Bhat
2017-07-27 9:36 ` Kalle Valo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170727093624.061F96095E@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=amitkarwar@gmail.com \
--cc=briannorris@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gbhat@marvell.com \
--cc=huxm@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nishants@marvell.com \
--cc=patila@marvell.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).