mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] net/mac80211/agg-tx: check the return value of rcu_dereference_protected_tid_tx()
@ 2022-09-02  7:57 Li Zhong
  2022-09-02 14:43 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zhong @ 2022-09-02  7:57 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-wireless
  Cc: johannes, davem, edumazet, kuba, pabeni, lily

From: lily <floridsleeves@gmail.com>

Check the return value of rcu_dereference_protected_tid_tx(), which
could be NULL and result in null pointer dereference if not checked.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 net/mac80211/agg-tx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 07c892aa8c73..ce5f4a39bce2 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -503,6 +503,8 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
 	int ret;
 
 	tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
+	if (!tid_tx)
+		return;
 
 	/*
 	 * Start queuing up packets for this aggregation session.
@@ -742,6 +744,8 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
 	lockdep_assert_held(&sta->ampdu_mlme.mtx);
 
 	tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
+	if (!tid_tx)
+		return;
 	params.buf_size = tid_tx->buf_size;
 	params.amsdu = tid_tx->amsdu;
 
-- 
2.25.1


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

end of thread, other threads:[~2022-09-02 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02  7:57 [PATCH v1] net/mac80211/agg-tx: check the return value of rcu_dereference_protected_tid_tx() Li Zhong
2022-09-02 14:43 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®