Skip to content

Commit ab499db

Browse files
Michal Kaziorjmberg-intel
authored andcommitted
mac80211: prevent possible crypto tx tailroom corruption
There was a possible race between ieee80211_reconfig() and ieee80211_delayed_tailroom_dec(). This could result in inability to transmit data if driver crashed during roaming or rekeying and subsequent skbs with insufficient tailroom appeared. This race was probably never seen in the wild because a device driver would have to crash AND recover within 0.5s which is very unlikely. I was able to prove this race exists after changing the delay to 10s locally and crashing ath10k via debugfs immediately after GTK rekeying. In case of ath10k the counter went below 0. This was harmless but other drivers which actually require tailroom (e.g. for WEP ICV or MMIC) could end up with the counter at 0 instead of >0 and introduce insufficient skb tailroom failures because mac80211 would not resize skbs appropriately anymore. Fixes: 8d1f7ec ("mac80211: defer tailroom counter manipulation when roaming") Signed-off-by: Michal Kazior <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 80279fb commit ab499db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mac80211/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ static void ieee80211_restart_work(struct work_struct *work)
246246
{
247247
struct ieee80211_local *local =
248248
container_of(work, struct ieee80211_local, restart_work);
249+
struct ieee80211_sub_if_data *sdata;
249250

250251
/* wait for scan work complete */
251252
flush_workqueue(local->workqueue);
@@ -254,6 +255,8 @@ static void ieee80211_restart_work(struct work_struct *work)
254255
"%s called with hardware scan in progress\n", __func__);
255256

256257
rtnl_lock();
258+
list_for_each_entry(sdata, &local->interfaces, list)
259+
flush_delayed_work(&sdata->dec_tailroom_needed_wk);
257260
ieee80211_scan_cancel(local);
258261
ieee80211_reconfig(local);
259262
rtnl_unlock();

0 commit comments

Comments
 (0)