mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Edward Adam Davis <eadavis@qq.com>,
	 syzbot+6554b492c7008bcd3385@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	 netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] wifi: mac80211: fix oob in ieee80211_rx_mgmt_beacon
Date: Tue, 17 Jun 2025 08:31:27 +0200	[thread overview]
Message-ID: <86bbb07755d748c9b582c0ab234e8a4ce0314ce4.camel@sipsolutions.net> (raw)
In-Reply-To: <tencent_8DCFF079526DB42E796E5095C0E8E2EE1E0A@qq.com>

On Tue, 2025-06-17 at 12:41 +0800, Edward Adam Davis wrote:
> According to ieee80211_s1g_optional_len(), it can be clearly seen that the
> maximum size of variable is 4 and it is an array. Based on the above, the
> parsing of the frame control field and optional field is optimized.
> 
> Fixes: 1e1f706fc2ce ("wifi: cfg80211/mac80211: correctly parse S1G beacon optional elements")
> Reported-by: syzbot+6554b492c7008bcd3385@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=6554b492c7008bcd3385
> Tested-by: syzbot+6554b492c7008bcd3385@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>  include/linux/ieee80211.h | 2 +-
>  net/mac80211/mlme.c       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
> index ce377f7fb912..556ce95e0b0f 100644
> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -1278,7 +1278,7 @@ struct ieee80211_ext {
>  			u8 sa[ETH_ALEN];
>  			__le32 timestamp;
>  			u8 change_seq;
> -			u8 variable[0];
> +			u8 variable[4];

That's incorrect when those fields aren't present, and will result in
wrong sizeof(). I believe the correct fix is one I sent before, to just
make it []:

https://lore.kernel.org/linux-wireless/20250614003037.a3e82e882251.I2e8b58e56ff2a9f8b06c66f036578b7c1d4e4685@changeid/

johannes

  reply	other threads:[~2025-06-17  6:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 16:48 [syzbot] [wireless?] UBSAN: array-index-out-of-bounds " syzbot
2025-06-17  1:12 ` Edward Adam Davis
2025-06-17  1:31   ` syzbot
2025-06-17  2:15 ` Edward Adam Davis
2025-06-17  2:53   ` syzbot
2025-06-17  3:23 ` Edward Adam Davis
2025-06-17  3:46   ` syzbot
2025-06-17  4:41 ` [PATCH] wifi: mac80211: fix oob " Edward Adam Davis
2025-06-17  6:31   ` Johannes Berg [this message]
2025-06-17  6:45   ` Lachlan Hodges
2025-06-17  7:46 ` [syzbot] [wireless?] UBSAN: array-index-out-of-bounds " Edward Adam Davis
2025-06-17  8:09   ` syzbot

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=86bbb07755d748c9b582c0ab234e8a4ce0314ce4.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+6554b492c7008bcd3385@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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®