summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2024-06-26 09:15:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-25 09:49:20 +0200
commit1d9bbbe6f28279c2002b9fbc1d76a47e9c41e9c9 (patch)
treee9c7028c449324327fc1692003efc5391c5a4879
parent95ad70db219d7c51afa4dfa8d53c2e1e999c31b3 (diff)
wifi: mac80211: disable softirqs for queued frame handling
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>
-rw-r--r--net/mac80211/main.c1
-rw-r--r--net/mac80211/util.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 89771f0e0ae7..1eec4e2eb74c 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -300,6 +300,7 @@ u32 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;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 08e6691cdc4a..738f1f139a90 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2207,7 +2207,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);