From: Francesco Dolcini <francesco@dolcini.it>
To: David Lin <yu-hao.lin@nxp.com>
Cc: Brian Norris <briannorris@chromium.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvalo@kernel.org" <kvalo@kernel.org>,
"francesco@dolcini.it" <francesco@dolcini.it>,
Pete Hsieh <tsung-hsien.hsieh@nxp.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [EXT] Re: [PATCH v2] wifi: mwifiex: fix STA cannot connect to AP
Date: Thu, 14 Dec 2023 08:35:27 +0100 [thread overview]
Message-ID: <ZXqwP7NscRtE1uGL@francesco-nb.int.toradex.com> (raw)
In-Reply-To: <PA4PR04MB96383A106724AC1CE683112BD18CA@PA4PR04MB9638.eurprd04.prod.outlook.com>
Hello David,
On Thu, Dec 14, 2023 at 02:22:57AM +0000, David Lin wrote:
> > From: Brian Norris <briannorris@chromium.org>
...
> > Nitpick: "fix STA cannot connect to AP" isn't the best commit message; that
> > could describe an enormous number of fixes. Maybe something more like
> > "Configure BSSID consistently when starting AP"?
>
> Thanks for your suggestion. I will change commit message as you
> suggested. Does it mean I should create another patch from v1?
Just create `[PATCH v3] wifi: mwifiex: fix STA cannot connect to AP`
Add the change suggested by Brian and the tags you received on this v2:
- Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
- Tested-by: Rafael Beims <rafael.beims@toradex.com> # Verdin iMX8MP / SD8997 SD
- Acked-by: Brian Norris <briannorris@chromium.org>
> > Not directly related to this patch, but while you're expanding the size of this
> > command buffer: it always felt like a security-hole-in-waiting that none of
> > these command producers do any kinds of bounds checking.
> > We're just "lucky" that these function only generate contents of ~100 bytes at
> > max, while MWIFIEX_SIZE_OF_CMD_BUFFER=2048. But, just add a few more
> > user-space controlled TLV params, and boom, we'll have ourselves a nice
> > little CVE.
> >
> > It probably wouldn't hurt to significantly write much of this driver, but at a
> > minimum, we could probably use a few checks like this:
> >
> > cmd_size += sizeof(struct host_cmd_tlv_mac_addr);
> > if (cmd_size > MWIFIEX_SIZE_OF_CMD_BUFFER)
> > return -1;
> > // Only touch tlv *after* the bounds check.
> >
> > That doesn't need to block this patch, of course.
> >
> > Brian
> >
>
> I will modify the code for next patch.
I would suggest not modify this in this patch, we should fix all the code that
is subjected to this potential issue.
I would personally do a follow-up patch just to add the check to avoid
overflowing the cmd buffer everywhere it is used.
Francesco
next prev parent reply other threads:[~2023-12-14 7:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 23:41 David Lin
2023-12-11 7:47 ` Francesco Dolcini
2023-12-11 17:29 ` Rafael Beims
2023-12-14 2:08 ` Brian Norris
2023-12-14 2:22 ` [EXT] " David Lin
2023-12-14 7:35 ` Francesco Dolcini [this message]
2023-12-14 11:38 ` David Lin
2023-12-14 18:52 ` Brian Norris
2023-12-14 23:05 ` David Lin
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=ZXqwP7NscRtE1uGL@francesco-nb.int.toradex.com \
--to=francesco@dolcini.it \
--cc=briannorris@chromium.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tsung-hsien.hsieh@nxp.com \
--cc=yu-hao.lin@nxp.com \
/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
all inboxes | Powered by JetHome®