mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Bagas Sanjaya <bagasdotme@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Networking <netdev@vger.kernel.org>,
	 Linux Wireless <linux-wireless@vger.kernel.org>
Cc: "Jouni Malinen" <jouni.malinen@atheros.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Emmanuel Grumbach" <emmanuel.grumbach@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jannik Glückert" <jannik.glueckert@gmail.com>
Subject: Re: Fwd: UBSAN: array-index-out-of-bounds in net/wireless/nl80211.c and net/mac80211/scan.c
Date: Thu, 09 May 2024 10:48:17 +0200	[thread overview]
Message-ID: <12b6ac611c1a44b4eadbb1316636b7268ab66a50.camel@sipsolutions.net> (raw)
In-Reply-To: <ZjwTyGqcey0HXxTT@archie.me>

On Thu, 2024-05-09 at 07:07 +0700, Bagas Sanjaya wrote:
> Hi,
> 
> Jannik Glückert <jannik.glueckert@gmail.com> reported on Bugzilla array index
> out-of-bounds catched by ubsan along with full kernel trace dump (see
> https://bugzilla.kernel.org/show_bug.cgi?id=218810):
> 
> > I am seeing multiple array-index-out-of-bounds related to `ieee80211_channel[]` iteration.
> > 
> > This is with a Mediatek MT7921 chipset.
> > I have only tested with kernel 6.8.9, but I don't see any channel index related fixes in master.
> > 
> > This was discovered as part of Gentoo Hardened enabling CONFIG_UBSAN_ARRAY_BOUNDS
> > 
> > 
> > [  106.194465] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys-kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/wireless/nl80211.c:9203:29
> > [  106.195063] index 42 is out of range for type 'struct ieee80211_channel *[]'

> > [  106.200924] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys-kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/wireless/nl80211.c:9252:5
> > [  106.200926] index 0 is out of range for type 'struct ieee80211_channel *[]'

At least one of these should be fixed by
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commit/?id=838c7b8f1f278404d9d684c34a8cb26dc41aaaa1

> > [  106.201036] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys-kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/mac80211/scan.c:364:4
> > [  106.201037] index 0 is out of range for type 'struct ieee80211_channel *[]'

No idea about that one. Send patches.

(Seriously. If you're running with bleeding edge toolchains that pretty
much nobody has yet, send patches.)

johannes


  reply	other threads:[~2024-05-09  9:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09  0:07 Bagas Sanjaya
2024-05-09  8:48 ` Johannes Berg [this message]
2024-05-09  9:17   ` Bagas Sanjaya
2024-05-09 10:49   ` Jannik Glückert
2024-05-09 10:52     ` Johannes Berg

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=12b6ac611c1a44b4eadbb1316636b7268ab66a50.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=bagasdotme@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=jannik.glueckert@gmail.com \
    --cc=jouni.malinen@atheros.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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®