Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH wireless-next] wifi: mwifiex: hold ack_status_lock while freeing pending ack frames
@ 2026-11-16  2:35 Changyul Lee
  0 siblings, 0 replies; only message in thread
From: Changyul Lee @ 2026-11-16  2:35 UTC (permalink / raw)
  To: Brian Norris
  Cc: Francesco Dolcini, linux-wireless, linux-kernel, Changyul Lee

mwifiex_clean_txrx() frees the frames left in priv->ack_status_frames
and destroys the IDR without ack_status_lock. It runs on every
disconnect from the event work, while mwifiex_clone_skb_for_tx_status()
can still add an entry from the mgmt TX or data TX path. idr_destroy()
then drops the new entry and leaks its skb, and idr_alloc() can write
to a node that idr_destroy() has already passed to call_rcu().

Hold ack_status_lock around both calls, as the other users of the IDR
do.

Fixes: 808bbebcc8fc ("mwifiex: add Tx status support for EAPOL packets")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
Found with a static analysis tool we are developing.

Compile-tested only, with x86_64_defconfig plus MWIFIEX_SDIO,
MWIFIEX_PCIE, MWIFIEX_USB and W=1.

 drivers/net/wireless/marvell/mwifiex/wmm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wireless/marvell/mwifiex/wmm.c
index 841505e83c7f..b889a58c7f6c 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -611,8 +611,10 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
 	}
 	atomic_set(&priv->adapter->bypass_tx_pending, 0);
 
+	spin_lock_bh(&priv->ack_status_lock);
 	idr_for_each(&priv->ack_status_frames, mwifiex_free_ack_frame, NULL);
 	idr_destroy(&priv->ack_status_frames);
+	spin_unlock_bh(&priv->ack_status_lock);
 }
 
 /*

base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-16  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  2:35 [PATCH wireless-next] wifi: mwifiex: hold ack_status_lock while freeing pending ack frames Changyul Lee

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