From: Maximilian Luz <luzmaximilian@gmail.com>
To: Brian Norris <briannorris@chromium.org>
Cc: Amitkumar Karwar <amitkarwar@gmail.com>,
Ganapathi Bhat <ganapathi.bhat@nxp.com>,
Xinming Hu <huxinming820@gmail.com>,
Kalle Valo <kvalo@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
netdev@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>,
Kaloyan Nikolov <konik98@gmail.com>
Subject: Re: [PATCH net] mwifiex: Increase AES key storage size to 256 bits
Date: Tue, 25 Aug 2020 22:18:42 +0200 [thread overview]
Message-ID: <65b14706-321d-4025-f199-a89768815dfe@gmail.com> (raw)
In-Reply-To: <CA+ASDXPoxdMb4b5d0Ayv=JFACHcq7EXub14pJtJfcCV2di95Rg@mail.gmail.com>
On 8/25/20 9:30 PM, Brian Norris wrote:
> Also, while technically the regressing commit (e18696786548 ("mwifiex:
> Prevent memory corruption handling keys")) was fixing a potential
> overflow, the encasing command structure (struct host_cmd_ds_command)
> is a union of a ton of other command layouts, and likely had plenty of
> padding at the end, which would at least explain why non-malicious
> scenarios weren't problematic pre-commit-e18696786548.
This is pretty much spot on, although as far as I can tell, the padding
comes from struct mwifiex_ie_type_key_param_set_v2. That contains a
key_params member, which is a union over all supported key types,
including other 256 bit types (like struct mwifiex_wapi_param).
I should also note that this fix also affects mwifiex_set_aes_key_v2(),
where sizeof(struct mwifiex_aes_param) is used to calculate the command
length of what looks like a command being sent to the chip. This should
probably be reviewed by someone with a bit more inside knowledge about
the driver, as this could potentially break something due to the commit
changing it from 16 to 32. I think, however, that this might actually
also fix a potential issue when setting 256 bit AES keys.
Regards,
Max
next prev parent reply other threads:[~2020-08-25 20:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 15:38 Maximilian Luz
2020-08-25 18:51 ` Dan Carpenter
2020-08-25 20:17 ` Maximilian Luz
2020-08-25 19:30 ` Brian Norris
2020-08-25 20:18 ` Maximilian Luz [this message]
2020-08-27 8:02 ` Kalle Valo
2020-08-27 13:16 ` [net] " Kalle Valo
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=65b14706-321d-4025-f199-a89768815dfe@gmail.com \
--to=luzmaximilian@gmail.com \
--cc=amitkarwar@gmail.com \
--cc=briannorris@chromium.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=ganapathi.bhat@nxp.com \
--cc=huxinming820@gmail.com \
--cc=konik98@gmail.com \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@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
all inboxes | Powered by JetHome®