[3.11.y.z extended stable] Patch "mac80211: fix scheduled scan rtnl deadlock" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Wed Dec 18 10:19:08 UTC 2013
This is a note to let you know that I have just added a patch titled
mac80211: fix scheduled scan rtnl deadlock
to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 338f67826c9b8be6ba3ee5a9ddc6724a23f4aca8 Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg at intel.com>
Date: Wed, 6 Nov 2013 10:34:36 +0100
Subject: mac80211: fix scheduled scan rtnl deadlock
commit 18db594a1005d908d995a2fc8f5a7bf4286fdca0 upstream.
When changing cfg80211 to use RTNL locking, this caused a
deadlock in mac80211 as it calls cfg80211_sched_scan_stopped()
from a work item that's on a workqueue that is flushed with
the RTNL held.
Fix this by simply using schedule_work(), the work only needs
to finish running before the wiphy is unregistered, no other
synchronisation (e.g. with suspend) is really required since
for suspend userspace is already blocked anyway when we flush
the workqueue so will only pick up the event after resume.
Fixes: 5fe231e87372 ("cfg80211: vastly simplify locking")
Reported-and-tested-by: Eliad Peller <eliadx.peller at intel.com>
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
net/mac80211/main.c | 1 +
net/mac80211/scan.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 091088a..ec53369 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1059,6 +1059,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
cancel_work_sync(&local->restart_work);
cancel_work_sync(&local->reconfig_filter);
+ flush_work(&local->sched_scan_stopped_work);
ieee80211_clear_tx_pending(local);
rate_control_deinitialize(local);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 7aafa54..89fb87b 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1033,6 +1033,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
trace_api_sched_scan_stopped(local);
- ieee80211_queue_work(&local->hw, &local->sched_scan_stopped_work);
+ schedule_work(&local->sched_scan_stopped_work);
}
EXPORT_SYMBOL(ieee80211_sched_scan_stopped);
--
1.8.3.2
More information about the kernel-team
mailing list