Skip to contentSkip to conversation

net/mac80211/agg-tx: check the return value of rcu_dereference_protected_tid_tx()

PATCH In review Li Zhong 2 participants 2 messages Sep 2, 2022

Subsystems (3)
lore
Share & tools
lore

Li Zhong

author
#0 lore raw

PATCH 1/1 net/mac80211/agg-tx: check the return value of rcu_dereference_protected_tid_tx()

From: lily <[email protected]>

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

---
 net/mac80211/agg-tx.c | 4 ++++
 1 file changed, 4 insertions(+)
net/mac80211/agg-tx.c +4 -0
index 07c892aa8c73..ce5f4a39bce2 100644
@@ -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;
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · Li Zhong

From: lily <[email protected]>

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

Except ... it can't happen?

johannes