From: Johannes Berg <johannes@sipsolutions.net>
To: 傅继晗 <fjhhz1997@gmail.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org,
"Óscar Alfonso Díaz" <oscar.alfonso.diaz@gmail.com>
Subject: Re: [PATCH] wifi: mac80211: fix monitor mode frame capture for real chanctx drivers
Date: Mon, 09 Mar 2026 07:53:06 +0100 [thread overview]
Message-ID: <8155c8f93c233e430c75c98bcdaea219b16e9596.camel@sipsolutions.net> (raw)
In-Reply-To: <20260308164510.5927-1-fjhhz1997@gmail.com> (sfid-20260308_174529_643449_E6D8C735)
On Sun, 2026-03-08 at 16:45 +0000, 傅继晗 wrote:
> Commit 0a44dfc07074 ("wifi: mac80211: simplify non-chanctx drivers")
> removed the fallback path in ieee80211_monitor_start_xmit() for when
> the monitor interface has no channel context assigned. This broke frame
> capture and injection for drivers that implement real channel context
> ops (as opposed to the ieee80211_emulate_* helpers), such as the mt76
> family, when a monitor interface runs alongside another interface
> (e.g. managed mode).
It actually broke the others too, as you note later.
> In that scenario the (virtual) monitor sdata does not get a chanctx of
> its own, even though there is an active one from the other interface.
> Before the simplification the code fell back to local->_oper_chandef;
> after it, the code goes straight to fail_rcu and silently drops every
> injected frame.
>
> Commit d594cc6f2c58 ("wifi: mac80211: restore non-chanctx injection
> behaviour") restored the fallback for drivers using emulate_chanctx,
> but explicitly left real chanctx drivers unfixed.
>
> Fix this by falling back to the first entry in local->chanctx_list
> when the monitor vif has no chanctx and the driver uses real channel
> contexts. This is analogous to how ieee80211_hw_conf_chan() already
> uses the same pattern.
I did have pretty much the same attempt at a fix:
https://lore.kernel.org/linux-wireless/20251216111909.25076-2-johannes@sipsolutions.net/
but it was reported to cause crashes on certain devices, so we didn't
think it was very safe at the time.
Is that no longer an issue?
johannes
next prev parent reply other threads:[~2026-03-09 6:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 16:45 [PATCH] wifi: mac80211: fix monitor mode frame capture for real chanctx drivers 傅继晗
2026-03-09 6:53 ` Johannes Berg [this message]
2026-03-09 10:45 ` 傅继晗
2026-03-16 10:38 ` Johannes Berg
[not found] ` <CA+bbHrX+xby2_drzo0457raoz-kgQ6eTCCHU91pR5BkvzMiq_A@mail.gmail.com>
2026-03-19 11:40 ` Óscar Alfonso Díaz
2026-03-25 0:15 ` 傅继晗
2026-03-25 10:59 ` Óscar Alfonso Díaz
2026-03-26 1:37 ` [PATCH v2] wifi: mac80211: fix the issue of NULL pointer access when deleting the virtual interface 傅继晗
2026-03-26 12:16 ` Óscar Alfonso Díaz
2026-03-29 21:55 ` Óscar Alfonso Díaz
2026-04-02 0:06 ` Óscar Alfonso Díaz
2026-04-21 8:50 ` Óscar Alfonso Díaz
2026-04-24 12:08 ` [PATCH] wifi: mac80211: restore monitor injection when coexisting with another VIF Brite
2026-04-24 12:17 ` Greg KH
2026-04-24 13:55 ` Johannes Berg
2026-04-24 14:17 ` Óscar Alfonso Díaz
2026-04-24 17:22 ` Brite
2026-04-25 0:34 ` Brite
2026-04-25 1:47 ` Lachlan Hodges
2026-04-25 2:43 ` Brite
2026-04-26 9:25 ` Óscar Alfonso Díaz
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=8155c8f93c233e430c75c98bcdaea219b16e9596.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=fjhhz1997@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=oscar.alfonso.diaz@gmail.com \
--cc=stable@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