From: Christian Lamparter <chunkeey@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
Wang Yan <wangyan01@kylinos.cn>
Cc: zilin@seu.edu.cn, linville@tuxdriver.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: p54: fix incorrect frame length check in p54_find_ie()
Date: Sun, 6 Sep 2026 16:24:38 +0200 [thread overview]
Message-ID: <5a29065b-87ae-4c63-873d-fa22b0899199@gmail.com> (raw)
In-Reply-To: <087d18429b448d5b63f922fd6779925f827134c7.camel@sipsolutions.net>
On 9/6/26 1:49 PM, Johannes Berg wrote:
> On Sun, 2026-09-06 at 13:06 +0200, Christian Lamparter wrote:
>>
>>> pos = (u8 *)mgmt->u.beacon.variable;
>>> end = skb->data + skb->len;
>>> while (pos < end) {
>>> if (pos + 2 + pos[1] > end)
>>> return NULL;
>>>
>>> if (pos[0] == ie)
>>> return pos;
>>>
>>> pos += 2 + pos[1];
>>> }
>>> return NULL;
>>
>> The check in the while loop and the checks within the while loop make sure that
>> no "pos" is returned unless the IE is still within skb->len.
>>
>> But true, it should have been *mgmt and not mgmt.
>
> FWIW, I dropped it because it really shouldn't have been there this way
> since 'mgmt' can be far bigger than needed since it contains the union
> for all kinds of action frames etc.
>
> I'm not even sure it's needed regardless of the next check since the
> beacon is built by mac80211.
>
> Just blindly patching one mistake for another doesn't help anyone.
Ok, alright? I just looked in both:
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/
Was there a patch already? Or did I missread the first sentence that hinted this was "dropped"?
Or do you want that Mr/Ms Yan (Sorry, but from what I was told, the name can be used for
both male and female) just post a new patch that removes the superfluous check.
About *mgmt vs mgmt: Yes, you are right. That said, that check came from sometime between
~2006-2008 ;). I don't think the struct back then already contained action frames with
sounding/beamforming/timing feedback. Still, I'm totally fine with it being "dropped" too.
If there was such a patch posted, please feel free to add a
"Acked-by: Christian Lamparter <chunkeey@gmail.com>" if you merge it.
Cheers,
Christian
next prev parent reply other threads:[~2026-09-06 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 8:12 Wang Yan
2026-09-06 11:06 ` Christian Lamparter
2026-09-06 11:49 ` Johannes Berg
2026-09-06 14:24 ` Christian Lamparter [this message]
2026-09-06 14:44 ` Johannes Berg
2026-09-07 2:49 ` [PATCH v2] wifi: p54: remove redundant " Wang Yan
2026-09-07 6:19 ` [PATCH] wifi: p54: fix incorrect " Wang Yan
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=5a29065b-87ae-4c63-873d-fa22b0899199@gmail.com \
--to=chunkeey@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=wangyan01@kylinos.cn \
--cc=zilin@seu.edu.cn \
/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®