Search Linux Wireless

[PATCH] mac80211: Fix deadlock in ieee80211_do_stop.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Greear <greearb@xxxxxxxxxxxxxxx>

We cannot call flush_work here because we are holding
RTNL and the worker thread(s) that will be called upon to
do the flushing might already be running a piece of work
that is blocking on RTNL.  That leads to deadlock and/or
OOM.

The ieee80211_iface_work method does nothing when sdata
is stopped (as it would be when the flush_work was called)
so it shouldn't be any big change to just cancel the work
entirely.

Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx>
---
:100644 100644 7aa8559... 073b42a... M	net/mac80211/iface.c
 net/mac80211/iface.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 7aa8559..073b42a 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -516,7 +516,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		}
 		/* fall through */
 	default:
-		flush_work(&sdata->work);
+		/* Cannot call flush_work here because we are holding
+		 * RTNL and the worker thread(s) that will be called upon to
+		 * do the flushing might already be running a piece of work
+		 * that is blocking on RTNL.  That leads to deadlock and/or
+		 * OOM.
+		 */
+		cancel_work_sync(&sdata->work);
 		/*
 		 * When we get here, the interface is marked down.
 		 * Call synchronize_rcu() to wait for the RX path
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux