Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Subject: Re: [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it
Date: Sun, 04 Oct 2026 22:11:07 +0200	[thread overview]
Message-ID: <e326af8e0b64b477359fbb5576130451179a2b82.camel@sipsolutions.net> (raw)
In-Reply-To: <20261004210122.3b67fb1a6a69.I9c4f85fb60160f377a24c1b8e5173966744e5f09@changeid>

On Sun, 2026-10-04 at 21:01 +0200, Johannes Berg wrote:
> 
> @@ -19703,10 +19795,8 @@ static int nl80211_pre_doit(const struct genl_split_ops *ops,
>  		if (internal_flags & NL80211_FLAG_CHECK_NETDEV_UP &&
>  		    !wdev_running(wdev)) {
>  			err = -ENETDOWN;

Ohh. Nice race - possibly only in hwsim tests.

hostapd can now react to RTM_NEWLINK so quickly that this rejects the
calls - previously we took rtnl and that avoided seeing !wdev_running().

I'll fix it by inserting an rtnl_lock()/rtnl_unlock() here:

> +	if (!need_rtnl) {
> +		if (rdev)
> +			get_device(&rdev->wiphy.dev);
> +		if (wdev)
> +			wdev_id = wdev->identifier;
> +		rcu_read_unlock();
> +	}

of course only if it needs NETDEV_UP, wdev->is_running is false and
netif_running() is true - that'll wait for the notifier to finish.

johannes

  reply	other threads:[~2026-10-04 20:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 19:01 [PATCH wireless-next 00/18] wifi: further RTNL redux Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 01/18] wifi: cfg80211: track netdev running state under wiphy mutex Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 02/18] wifi: nl80211: allow device lookup under RCU Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it Johannes Berg
2026-10-04 20:11   ` Johannes Berg [this message]
2026-10-05  4:18   ` kernel test robot
2026-10-05  5:28     ` Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 04/18] wifi: nl80211: don't take rtnl for most dumps Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 05/18] wifi: cfg80211: reg: update channels under wiphy mutex Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 06/18] wifi: cfg80211: reg: set intersected regd " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 07/18] wifi: cfg80211: update channel DFS data " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 08/18] wifi: mac80211_hwsim: call cfg80211 event with " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 09/18] wifi: cfg80211: document wiphy mutex for radar/CAC events Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 10/18] wifi: cfg80211: add a mutex for regulatory/device list Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 11/18] wifi: cfg80211: allow walking wiphy list under cfg80211_mutex Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 12/18] wifi: ath: use freq_reg_info() under RCU Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 13/18] wifi: brcmsmac: " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 14/18] wifi: rtlwifi: " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 15/18] wifi: nl80211: read WMM reg rule " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 16/18] wifi: ath11k: read wiphy regd " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 17/18] wifi: ath12k: " Johannes Berg
2026-10-04 19:01 ` [PATCH wireless-next 18/18] wifi: cfg80211: regulatory: stop using RTNL 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=e326af8e0b64b477359fbb5576130451179a2b82.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@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