• Johannes Berg's avatar
    mac80211: fix scheduled scan rtnl deadlock · 18db594a
    Johannes Berg authored
    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: 5fe231e8 ("cfg80211: vastly simplify locking")
    Reported-and-tested-by: default avatarEliad Peller <eliadx.peller@intel.com>
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    18db594a
main.c 31 KB