From: Johannes Berg <johannes@sipsolutions.net>
To: Dan Carpenter <error27@gmail.com>, Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Raja Mani <rmani@qca.qualcomm.com>,
Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>,
Jouni Malinen <jouni@qca.qualcomm.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] wifi: cfg80211: don't allow negative key_len values
Date: Thu, 30 Apr 2026 09:05:35 +0200 [thread overview]
Message-ID: <fd142d26dbc632b26fe39ba8be29d4915a9f92d6.camel@sipsolutions.net> (raw)
In-Reply-To: <afLzlDT5VF4D746w@stanley.mountain> (sfid-20260430_081554_647821_E5F802AD)
On Thu, 2026-04-30 at 09:15 +0300, Dan Carpenter wrote:
> The ath6kl_cfg80211_add_key() function has an upper bounds check on
> params->key_len which ensures that it can't go over WLAN_MAX_KEY_LEN but
> it doesn't check for negatives. This could potentially lead to memory
> corruption.
>
> Put a bounds check on negative values in cfg80211_validate_key_settings()
> to prevent this sort of bug in the future.
Clearly this commit doesn't seem problematic, but I'm not sure I see the
path to it mattering? The key_len should only ever be set by
wext/nl80211, and that can't really end up with a negative length?
We should probably just make it a u8 there, no way it's ever bigger than
that, but I'm not seeing through why this would matter much right now.
johannes
next prev parent reply other threads:[~2026-04-30 7:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 6:15 [PATCH] wifi: cfg80211: don't allow negative key_len values Dan Carpenter
2026-04-30 7:05 ` Johannes Berg [this message]
2026-04-30 7:52 ` Dan Carpenter
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=fd142d26dbc632b26fe39ba8be29d4915a9f92d6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=error27@gmail.com \
--cc=jouni@qca.qualcomm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@qca.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rmani@qca.qualcomm.com \
--cc=vthiagar@qca.qualcomm.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