From: Johannes Berg <johannes@sipsolutions.net>
To: enderaoelyther@gmail.com
Cc: "John W. Linville" <linville@tuxdriver.com>,
Javier Lopez <jlopex@gmail.com>,
Jukka Rissanen <jukka.rissanen@linux.intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] wifi: mac80211_hwsim: serialize radio removal with frame commands
Date: Wed, 11 Nov 2026 21:34:12 +0100 [thread overview]
Message-ID: <27d2c98928859d47b2c3cf76870d868882685809.camel@sipsolutions.net> (raw)
In-Reply-To: <CACHPgzw-JeorCAX-b5jjd6d5=L0oYpPdGtstUSaz5sPKZE2HsQ@mail.gmail.com> (sfid-20261111_204546_211086_1FE84B1B)
On Wed, 2026-11-11 at 14:45 -0500, enderaoelyther@gmail.com wrote:
>
>
> The underlying problem is per-radio object lifetime, not command
> serialization. get_hwsim_data_ref_from_addr() returns a radio pointer
> after rhashtable_lookup_fast() has already ended its RCU read-side
> protection. A concurrent deletion can then unpublish and free that radio
> while a frame, TX-status, or PMSR command is still using the pointer.
>
> I reworked the fix around a per-radio reference count.
I'm not convinced that's necessary.
There are three users of get_hwsim_data_ref_from_addr:
hwsim_tx_info_frame_received_nl() just doesn't do anything that sleeps,
so it could just use RCU protection directly?
hwsim_cloned_frame_received_nl() uses it twice - the inner use is not an
issue as above, and the outer one is just acquiring the mutex for
synchronization with ->started, but given that mac80211 will sync RCU in
stop that's perhaps just not needed at all? Or maybe hwsim just needs to
synchronize_net() on stop.
hwsim_pmsr_report_nl() uses the mutex for pmsr_request access/swap and
GFP_KERNEL, but both of those could change? might need some more work
for abort though, not sure.
Dunno if that's better overall? Maybe, maybe not.
johannes
next prev parent reply other threads:[~2026-11-11 20:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 14:17 [PATCH 0/2] wifi: mac80211_hwsim: fix netlink release and radio removal races Zhao Li
2026-10-28 14:17 ` [PATCH 1/2] wifi: mac80211_hwsim: ignore non-generic netlink releases Zhao Li
2026-10-28 14:17 ` [PATCH 2/2] wifi: mac80211_hwsim: serialize radio removal with frame commands Zhao Li
2026-11-10 10:54 ` Johannes Berg
2026-11-11 19:45 ` enderaoelyther
2026-11-11 20:34 ` Johannes Berg [this message]
2026-10-29 8:38 ` [syzbot ci] Re: wifi: mac80211_hwsim: fix netlink release and radio removal races syzbot ci
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=27d2c98928859d47b2c3cf76870d868882685809.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=enderaoelyther@gmail.com \
--cc=jlopex@gmail.com \
--cc=jukka.rissanen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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
all inboxes | Powered by JetHome®