From: Changyul Lee <lcy8047@gmail.com>
To: Brian Norris <briannorris@chromium.org>
Cc: Francesco Dolcini <francesco@dolcini.it>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Changyul Lee <lcy8047@gmail.com>
Subject: [PATCH wireless-next] wifi: mwifiex: hold ack_status_lock while freeing pending ack frames
Date: Sun, 15 Nov 2026 21:35:00 -0500 [thread overview]
Message-ID: <20261116023500.577610-1-lcy8047@gmail.com> (raw)
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
reply other threads:[~2026-11-16 2:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116023500.577610-1-lcy8047@gmail.com \
--to=lcy8047@gmail.com \
--cc=briannorris@chromium.org \
--cc=francesco@dolcini.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).