mac80211: fix deadlock in driver-managed RX BA session start
authorJohannes Berg <johannes.berg@intel.com>
Wed, 6 Sep 2017 13:01:42 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:47:25 +0000 (09:47 +0200)
commit05975ba8b0cd9efed2104d01d6b68f29cf2f8177
treea93aebc66ef605701deb3714fa572e6efd01db6e
parent0451fbad733205821563d4ad1a736e127a5e63fb
mac80211: fix deadlock in driver-managed RX BA session start

commit bde59c475e0883e4c4294bcd9b9c7e08ae18c828 upstream.

When an RX BA session is started by the driver, and it has to tell
mac80211 about it, the corresponding bit in tid_rx_manage_offl gets
set and the BA session work is scheduled. Upon testing this bit, it
will call __ieee80211_start_rx_ba_session(), thus deadlocking as it
already holds the ampdu_mlme.mtx, which that acquires again.

Fix this by adding ___ieee80211_start_rx_ba_session(), a version of
the function that requires the mutex already held.

Fixes: 699cb58c8a52 ("mac80211: manage RX BA session offload without SKB queue")
Reported-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/agg-rx.c
net/mac80211/ht.c
net/mac80211/ieee80211_i.h