wifi: nxpwifi: fix two block ack teardown bugs
Subsystems (2)
cover wifi: nxpwifi: fix two block ack teardown bugs
Two independent bugs in the block ack teardown paths, both found by code inspection on next-20260825 and compile tested only.
The first leaves nxpwifi_11n_delete_tx_ba_stream_tbl_entry() unable to delete anything, so Tx BA stream entries leak on every teardown and aggregation eventually stops being negotiated. The second holds the RCU read lock across a teardown that sleeps, which splats under CONFIG_DEBUG_ATOMIC_SLEEP when a station deauthenticates from the AP.
David Carlier (2):
wifi: nxpwifi: fix inverted check in Tx BA stream entry deletion
wifi: nxpwifi: do not delete Rx reorder entries under RCU
drivers/net/wireless/nxp/nxpwifi/11n.c | 2 +- drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
2.55.0
PATCH 1/2 wifi: nxpwifi: fix inverted check in Tx BA stream entry deletion
nxpwifi_is_tx_ba_stream_ptr_valid() returns true when the entry is still linked, and every caller passes an entry that is on the list, so the early return always fires and nothing is ever unlinked or freed. Entries leak on every teardown and, since nxpwifi_space_avail_for_new_ba_stream() counts them, Tx aggregation stops being negotiated once the stale count reaches the maximum.
Changing the original dead && test to || to silence a NULL dereference report inverted the validity test along with it.
--- drivers/net/wireless/nxp/nxpwifi/11n.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/nxp/nxpwifi/11n.c +1 -1
@@ -451,7 +451,7 @@ void nxpwifi_11n_delete_tx_ba_stream_tbl_entry(struct nxpwifi_private *priv, struct nxpwifi_tx_ba_stream_tbl *tbl) { -if (!tbl ||nxpwifi_is_tx_ba_stream_ptr_valid (priv, tbl)) +if (!tbl || !nxpwifi_is_tx_ba_stream_ptr_valid (priv, tbl))return ; nxpwifi_dbg(priv->adapter, INFO,
Signature · 1 line
2.55.0
PATCH 2/2 wifi: nxpwifi: do not delete Rx reorder entries under RCU
In reply to David CarlierThe RCU guard is declared in the body of the per-TID loop, so it is still held across the teardown pass. nxpwifi_del_rx_reorder_entry() flushes the Rx workqueue and deletes the reorder timer synchronously, both of which sleep, so a station deauthenticating from the AP splats under CONFIG_DEBUG_ATOMIC_SLEEP.
Scope the guard to the collection walk. The teardown does not need RCU: it serialises on priv->rx_reorder_tbl_lock[] and frees with kfree_rcu().
--- drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c +6 -5
@@ -205,11 +205,12 @@ void nxpwifi_11n_del_rx_reorder_tbl_by_ta(struct nxpwifi_private *priv, u8 *ta)return ;for (i =0 ; i <MAX_NUM_TID ; i++) { -guard (rcu)(); -list_for_each_entry_rcu (tbl, &priv->rx_reorder_tbl_ptr[i], list) { -if (!memcmp (tbl->ta, ta,ETH_ALEN )) { -INIT_LIST_HEAD (&tbl->tmp_list); -list_add_tail (&tbl->tmp_list, &to_delete); +scoped_guard (rcu) { +list_for_each_entry_rcu (tbl, &priv->rx_reorder_tbl_ptr[i], list) { +if (!memcmp (tbl->ta, ta,ETH_ALEN )) { +INIT_LIST_HEAD (&tbl->tmp_list); +list_add_tail (&tbl->tmp_list, &to_delete); + } } }
Signature · 1 line
2.55.0