All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: mac80211: don't ask rate control with zero rate mask if scanning
@ 2024-01-17 12:48 Dmitry Antipov
  2024-01-18 13:46 ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Antipov @ 2024-01-17 12:48 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Felix Fietkau, Kalle Valo, linux-wireless, lvc-project,
	Dmitry Antipov, syzbot+fdc5123366fb9c3fdc6d

If we're scanning and got the control frame with zero rate mask, drop
the frame before '__rate_control_send_low()' getting stuck attempting
to select supported rate.

Reported-by: syzbot+fdc5123366fb9c3fdc6d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=fdc5123366fb9c3fdc6d
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 net/mac80211/tx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 314998fdb1a5..53a473a2f8dd 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -701,7 +701,12 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
 	txrc.bss_conf = &tx->sdata->vif.bss_conf;
 	txrc.skb = tx->skb;
 	txrc.reported_rate.idx = -1;
-	txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band];
+
+	if (tx->sdata->rc_rateidx_mask[info->band])
+		txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band];
+	else if (test_bit(SCAN_SW_SCANNING, &tx->local->scanning))
+		/* we're scanning but have no usable rates */
+		return TX_DROP;
 
 	if (tx->sdata->rc_has_mcs_mask[info->band])
 		txrc.rate_idx_mcs_mask =
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-26 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-17 12:48 [PATCH] wifi: mac80211: don't ask rate control with zero rate mask if scanning Dmitry Antipov
2024-01-18 13:46 ` Johannes Berg
2024-01-19  8:07   ` Dmitry Antipov
2024-01-19 17:19     ` Johannes Berg
2024-01-24 15:11       ` Dmitry Antipov
2024-01-25  9:07       ` [PATCH 0/1] " Dmitry Antipov
2024-01-25  9:07         ` [PATCH 1/1] wifi: mac80211: ignore the bitrate mask when scanning Dmitry Antipov
2024-01-26 10:06           ` Johannes Berg
2024-01-26 10:05         ` [PATCH 0/1] Re: wifi: mac80211: don't ask rate control with zero rate mask if scanning Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.