]> git.hungrycats.org Git - linux/commitdiff
wifi: mac80211: disable softirqs for queued frame handling
authorJohannes Berg <johannes.berg@intel.com>
Wed, 26 Jun 2024 07:15:59 +0000 (09:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:41 +0000 (09:53 +0200)
commit 321028bc45f01edb9e57b0ae5c11c5c3600d00ca upstream.

As noticed by syzbot, calling ieee80211_handle_queued_frames()
(and actually handling frames there) requires softirqs to be
disabled, since we call into the RX code. Fix that in the case
of cleaning up frames left over during shutdown.

Fixes: 177c6ae9725d ("wifi: mac80211: handle tasklet frames before stopping")
Reported-by: syzbot+1d516edf1e74469ba5d3@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20240626091559.cd6f08105a6e.I74778610a5ff2cf8680964698131099d2960352a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/main.c
net/mac80211/util.c

index 1132dea0e290ea9ca06240cd09a5f11aba278f4c..0965ad11ec74761f761aeca9e9948c3550967a7b 100644 (file)
@@ -423,6 +423,7 @@ u64 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
               BSS_CHANGED_ERP_SLOT;
 }
 
+/* context: requires softirqs disabled */
 void ieee80211_handle_queued_frames(struct ieee80211_local *local)
 {
        struct sk_buff *skb;
index cc04b001f0c36fdc8e3e29b81e0b84d0841153df..cd4573723999eada11bbd5435e6c4b9c88cc4708 100644 (file)
@@ -1567,7 +1567,9 @@ u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata,
 
 void ieee80211_stop_device(struct ieee80211_local *local)
 {
+       local_bh_disable();
        ieee80211_handle_queued_frames(local);
+       local_bh_enable();
 
        ieee80211_led_radio(local, false);
        ieee80211_mod_tpt_led_trig(local, 0, IEEE80211_TPT_LEDTRIG_FL_RADIO);