]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix scheduled scan rtnl deadlock
authorJohannes Berg <johannes.berg@intel.com>
Wed, 6 Nov 2013 09:34:36 +0000 (10:34 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Nov 2013 15:50:04 +0000 (16:50 +0100)
commitc923312b14793c404f5c73e2d70c51b89fa657ff
treea5a9f4ba683bcafd3f6491d8cfea3c27fdc0bcf9
parentc468c42ea2bc3a367c6727be3c1d7e777cd1bee0
mac80211: fix scheduled scan rtnl deadlock

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.

Cc: stable@vger.kernel.org
Fixes: 0403a5ec2fc0 ("cfg80211: vastly simplify locking")
Reported-and-tested-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c
net/mac80211/scan.c