* [PATCH AUTOSEL 4.14] wifi: cfg80211: lock wiphy mutex for rfkill poll
@ 2023-12-04 20:37 Sasha Levin
2023-12-04 20:50 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2023-12-04 20:37 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Johannes Berg, syzbot+7e59a5bfc7a897247e18, Sasha Levin, johannes,
davem, edumazet, kuba, pabeni, linux-wireless, netdev
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 8e2f6f2366219b3304b227bdd2f04b64c92e3e12 ]
We want to guarantee the mutex is held for pretty much
all operations, so ensure that here as well.
Reported-by: syzbot+7e59a5bfc7a897247e18@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/wireless/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 0e08629b15d1d..abe7912a23760 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -202,7 +202,9 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data)
{
struct cfg80211_registered_device *rdev = data;
+ wiphy_lock(&rdev->wiphy);
rdev_rfkill_poll(rdev);
+ wiphy_unlock(&rdev->wiphy);
}
void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH AUTOSEL 4.14] wifi: cfg80211: lock wiphy mutex for rfkill poll
2023-12-04 20:37 [PATCH AUTOSEL 4.14] wifi: cfg80211: lock wiphy mutex for rfkill poll Sasha Levin
@ 2023-12-04 20:50 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2023-12-04 20:50 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: syzbot+7e59a5bfc7a897247e18, davem, edumazet, kuba, pabeni,
linux-wireless, netdev
On Mon, 2023-12-04 at 15:37 -0500, Sasha Levin wrote:
>
> +++ b/net/wireless/core.c
> @@ -202,7 +202,9 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data)
> {
> struct cfg80211_registered_device *rdev = data;
>
> + wiphy_lock(&rdev->wiphy);
This can't even _build_ on this old kernel?!
Anyway, my locking rework only went into 6.7, so this doesn't make sense
in any stable kernel, it's just not required.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-04 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 20:37 [PATCH AUTOSEL 4.14] wifi: cfg80211: lock wiphy mutex for rfkill poll Sasha Levin
2023-12-04 20:50 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).