public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+5506b2556159a1ab6923@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [wireless?] INFO: task hung in cfg80211_event_work (4)
Date: Sun, 13 Oct 2024 19:53:20 -0700	[thread overview]
Message-ID: <670c87a0.050a0220.3e960.0050.GAE@google.com> (raw)
In-Reply-To: <6707f07f.050a0220.64b99.001b.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [wireless?] INFO: task hung in cfg80211_event_work (4)
Author: lizhi.xu@windriver.com

When hwsim and regulatory are used simultaneously, a race occurs for the
lock "wiphy.mtx", it cause hung in cfg80211_event_work.
The hwsim is a developer testing tool, so maybe using mutex_trylock
insead of mutex_lock is more reasonable.

#syz test

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 661adfc77644..4e8a6c76b12d 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -331,7 +331,8 @@ static void cfg80211_event_work(struct work_struct *work)
 	rdev = container_of(work, struct cfg80211_registered_device,
 			    event_work);
 
-	wiphy_lock(&rdev->wiphy);
+	if (!mutex_trylock(&rdev->wiphy.mtx))
+		return;
 	cfg80211_process_rdev_events(rdev);
 	wiphy_unlock(&rdev->wiphy);
 }

      parent reply	other threads:[~2024-10-14  2:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 15:19 [syzbot] [wireless?] INFO: task hung in cfg80211_event_work (4) syzbot
2024-10-10 16:44 ` Ben Greear
2024-10-14  9:54   ` Aleksandr Nogikh
2024-10-14 14:38     ` Ben Greear
2024-10-14  2:53 ` syzbot [this message]

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=670c87a0.050a0220.3e960.0050.GAE@google.com \
    --to=syzbot+5506b2556159a1ab6923@syzkaller.appspotmail.com \
    --cc=linux-kernel@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