From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796284075; b=ZxgXHBkcseZAFhw/rDewnSi+AjoOybkCAe2NPLPlsHuV0Jd1vhYaANQ7xJVwrpwp3VM+ 4G2HCcSVCagDBuFf9PS76Ai2Az3f3JXM3mbc8/a5pU3H6QV2nalddO0Rl21Z850t03QGO aJnJ7ybnSklIeem4s/K7eJglEXRwPonZQD9PLYneh7WumRQIME7aQr+T8tZmrPkwHRFId g0VybW7zzgGteimsHQJBq5cc+h8+fSTY9MYNi76vLi+1+n0gRRDcdk2bRgaKcVJPTHUg0 e495VtDoppf2HN+P61g3Rt3QIcOmZf8jsgNnqyqNzUmHJYqkem4XV9G3cvqwneaEcBw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284075; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=gBjDSMuLpwpv1DLj32Rf2qA55nzDRJeY2gcaSFPyQsc=; b=FaEslL6XgdAVLyshmAfX3k5QtdxB1RBmJKGFedJRyxDLzCOiMPH5x7OJU64EsvGrHgoW +iX92IzZq2vjznejU0lPCT51+2qFOoN0TA34M1e15bY8x9cr7qGhBbPD+SatCDdfTL40L UI2RTPHym5/wQRyqVZfIcFAtCKkiYR29LjhtEm6ky5t/kSpfRxzqaWjX+vCfAGW5yQqD+ fVlS2IGjrJjRmsWwJSw6UWYrTUOakS2H2c3ZogGaW6tHMqmtSU2W0avZThENkFBLTFBw+ KzkyZgjBpCdQXBK61yirJUgqA5F1GA38G6MjSkDHo2qqsimsgT31KdY1QApdriHYVVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V83HMsRI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08380606A322 for ; Thu, 3 Dec 2026 07:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V83HMsRI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 643C61F000C1; Thu, 3 Dec 2026 07:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796284074; bh=gBjDSMuLpwpv1DLj32Rf2qA55nzDRJeY2gcaSFPyQsc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=V83HMsRIb4MgeIM1XN+ZWQGabPYYPDU1mq87EQsqRzF/96hfV5/119I+8hrim4inF AwQyQeaB6amXRXD4L0Tu9x17HMYhaKO+NsgF47Eib7HL4xnArKR9C3TDpie8uOBevW HPyVvzyofu8W7JaVtF8FLzIim7dZGNNtZr206/mJf8Cjf2ZtXR2pG7BieBEzakwySl 4RZZ/GaE2OuMCO1h4vPD7B8RfKVc2/8HSq8bPUz5DpduhhQlOLK5YDjW976KzTttBI 5ShixEp8v4SXoBTlZ/tLmSR79wOj66AC6snIJ3r1wzV5ff8YXEq/nkdieUJBzViDKB dOLNpeV06EHmQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v6 11/17] wifi: cc33xx: Add tx.c, tx.h Reply-To: sashiko-reviews@lists.linux.dev To: "Ramesh Ramalingam" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203070906.1294171-12-r-ramalingam@ti.com> References: <20261203070906.1294171-1-r-ramalingam@ti.com> <20261203070906.1294171-12-r-ramalingam@ti.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 07:47:54 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 20 potential issues to consider: - [High] wifi: cc33xx: IEEE80211_HT_CTL_LEN TX gap never stripped on completion/reset - [High] wifi: cc33xx: missing ieee80211_tx_info_clear_status() corrupts TX status - [High] wifi: cc33xx: netstack_work queued on freezable_wq instead of netstack wq - [High] wifi: cc33xx: cc33xx_send_tx_pending_pkts() misses TX_PENDING flag - [High] wifi: cc33xx: unlocked core_status->fw_info reads race with IRQ DMA - [High] wifi: cc33xx: use-after-free of RCU info->control.hw_key in TX path - [High] wifi: cc33xx: cc33xx_tx_complete_packet() never increments total_freed_pkts - [Medium] wifi: cc33xx: SKB leaked on cc33xx_tx_buf_write() error in -EAGAIN path - [Medium] wifi: cc33xx: cc33xx_tx_reset() leaks per-link allocated_pkts in AP mode - [Medium] wifi: cc33xx: lost TX wakeups across wake_queues(), complete(), wake_txq - [Medium] wifi: cc33xx: cc33xx_wake_queues() wakes queues while stop reasons hold - [Medium] wifi: cc33xx: TX work fragments SDIO writes and redundantly zeroes aggr_buf - [Medium] wifi: cc33xx: cc33xx_send_tx_pending_pkts() nests prio loop inside hlid loop - [Medium] wifi: cc33xx: infinite -EAGAIN loop in cc33xx_tx_allocate() callers - [Medium] wifi: cc33xx: cc33xx_tx_reset() leaves last_fw_rls_idx stale across recovery - [Medium] wifi: cc33xx: cc33xx_send_txq_pkts() drops aggr_buf on invalid hlid - [Low] wifi: cc33xx: commit message cites nonexistent cc33xx_tx_work_locked() - [Low] wifi: cc33xx: cc33xx_tx_immediate_complete() overwrites error ret in loop - [Low] wifi: cc33xx: cc33xx_send_txq_pkts() takes cc_lock per packet to check queue - [Low] wifi: cc33xx: cc33xx_tx_flush() polls with msleep(20) under wiphy lock -- commit f12741bd53441412dcd5a8c8fd7b196d2953e3dd Author: Michael Nemanov wifi: cc33xx: Add tx.c, tx.h This commit adds the TX path for the cc33xx wireless driver, including frame preparation, aggregation, queue management, and TX completion handling. > or from the deferred IRQ context (irq_deferred_work). Both trigger > cc->tx_work (cc33xx_tx_work @ tx.c) which will call > cc33xx_tx_work_locked where data from MAC80211 SKBs will be packed > and transferred to HW. [Severity: Low] This isn't a bug, but cc33xx_tx_work() actually calls cc33xx_do_tx_work(), and there is no cc33xx_tx_work_locked() in the driver. > diff --git a/drivers/net/wireless/ti/cc33xx/tx.c b/drivers/net/wireless/t= i/cc33xx/tx.c > new file mode 100644 > index 0000000000000..a616afd5ad3fa > --- /dev/null > +++ b/drivers/net/wireless/ti/cc33xx/tx.c [ ... ] > +static int cc33xx_tx_allocate(struct cc33xx *cc, struct sk_buff *skb, > + u32 extra, u32 buf_offset, u8 hlid, > + struct nab_tx_header *nab_cmd) > +{ > + struct cc33xx_tx_hw_descr *desc; > + u32 total_blocks; > + int id, ret =3D -EBUSY, ac; > + u32 spare_blocks; > + u32 total_skb_len =3D skb->len + extra; > + /* Add NAB command required for CC33xx architecture */ > + u32 total_len =3D sizeof(struct nab_tx_header); > + > + total_skb_len +=3D sizeof(struct cc33xx_tx_hw_descr); > + total_len +=3D total_skb_len; > + > + cc33xx_debug(cc->dev, DEBUG_TX, "cc->tx_blocks_available %d\n", > + cc->tx_blocks_available); > + > + if (buf_offset + total_len > cc->aggr_buf_size) > + return -EAGAIN; [Severity: Medium] Can this cause an infinite loop if a single frame exceeds cc->aggr_buf_size? When buf_offset is already 0 and total_len > cc->aggr_buf_size, returning -EAGAIN makes cc33xx_send_txq_pkts() and cc33xx_send_tx_pending_pkts() call cc33xx_tx_buf_write(cc, 0) (which returns 0 immediately) and jump back to try_again forever while holding cc->mutex, hanging the worker and wedging the driver. Because mac80211 enables software monitor interfaces with an uncapped max_mtu, an injected frame larger than 32 KB can reach this path. Returning a fatal error such as -EMSGSIZE when total_len > cc->aggr_buf_size would let callers drop the skb instead of retrying. [ ... ] > +static bool cc33xx_lnk_high_prio(struct cc33xx *cc, u8 hlid, > + struct cc33xx_link *lnk) > +{ > + u8 thold; > + struct core_fw_status *core_fw_status =3D &cc->core_status->fw_info; > + unsigned long suspend_bitmap, fast_bitmap, ps_bitmap; > + > + suspend_bitmap =3D le32_to_cpu(core_fw_status->link_suspend_bitmap); > + fast_bitmap =3D le32_to_cpu(core_fw_status->link_fast_bitmap); > + ps_bitmap =3D le32_to_cpu(core_fw_status->link_ps_bitmap); [Severity: High] Can these reads of cc->core_status->fw_info race with IRQ DMA? CPU0 (cc33xx_do_tx_work) CPU1 (cc33xx_irq) mutex_lock(&cc->mutex) claim_core_status_lock(cc) ... read_core_status(cc, cc->core_status) cc33xx_lnk_high_prio() /* SDIO/SPI DMA into core_status */ read core_status->fw_info process_core_status() <-- data race / DMA hazard memcpy/memset(cc->core_status, ...) cc33xx_lnk_high_prio() and cc33xx_lnk_low_prio() only hold cc->mutex, whereas cc33xx_irq() updates cc->core_status under claim_core_status_lock(). Reading cc->core_status during an active bus DMA transfer violates DMA buffer ownership on non-coherent ARM/ARM64 SoCs and can corrupt adjacent core_status fields or return torn/zeroed flow-control bitmaps. Taking claim_core_status_lock() (as cc33xx_tx_immediate_complete() does) or snapshotting fw_info under that lock would avoid the race. [ ... ] > +static int cc33xx_send_txq_pkts(struct cc33xx *cc, int qid, bool low_pri= o_tx) > +{ > + struct cc33xx_vif *wlvif =3D NULL; > + struct cc33xx_link *lnk =3D NULL; > + struct ieee80211_txq *txq =3D NULL; > + u8 hlid =3D CC33XX_INVALID_LINK_ID; > + struct sk_buff *skb =3D NULL; > + u32 buf_offset =3D 0; > + int ac =3D CONF_TX_AC_BE; > + int ret =3D 0; > + bool tx_allowed =3D true; > + > + memset(cc->aggr_buf, 0, 0x300); [Severity: Medium] Is this memset() needed, and does resetting buf_offset per call fragment SDIO writes? cc33xx_do_tx_work() calls cc33xx_send_tx_pending_pkts() once and cc33xx_send_txq_pkts() eight times (four ACs across two priority passes). Because each call keeps a local buf_offset and flushes via cc33xx_tx_buf_write(), a single TX batch splits into up to nine separate SDIO transactions (each claiming the host and padding to 256 bytes), and memset(cc->aggr_buf, 0, 0x300) unconditionally zeroes 6 KB per run even when queues are empty, despite cc33xx_prepare_tx_frame() and cc33xx_tx_buf_write() overwriting every transmitted byte. Passing a shared buf_offset through cc33xx_do_tx_work() and dropping the memset() would allow aggregating across ACs and priority passes in one bus write. > + while ((txq =3D ieee80211_next_txq(cc->hw, qid))) { > + ac =3D cc33xx_tx_get_queue(txq->ac); > + wlvif =3D cc33xx_vif_to_data(txq->vif); > + hlid =3D cc33xx_tx_get_hlid(cc, wlvif, NULL, txq->sta); > + > + /* hlid invalid. Shouldn't happen */ > + if (WARN_ON_ONCE(hlid =3D=3D CC33XX_INVALID_LINK_ID)) { > + ieee80211_return_txq(cc->hw, txq, false); > + return -EINVAL; > + } [Severity: Medium] Does returning -EINVAL here strand frames already prepared into cc->aggr_buf from earlier TXQs? For each earlier frame, cc33xx_tx_allocate() already reserved a slot in cc->tx_frames[] and decremented cc->tx_blocks_available, so returning without calling cc33xx_tx_buf_write(cc, buf_offset) means firmware never sees those frames or sends TX completions. When cc33xx_do_tx_work() is called from cc33xx_stop_dev(), none of its callers queue recovery on error, leaving those skbs and TX descriptors leaked until an unrelated reset. In a multi-interface setup, this can be reached if cc33xx_bss_info_changed_ap() clears wlvif->ap.bcast_hlid before clearing WLVIF_FLAG_AP_STARTED, or if cc33xx_join() fails during STA connection. Flushing cc->aggr_buf (or skipping the invalid TXQ instead of aborting the batch) would avoid stranding already-allocated descriptors. > + lnk =3D &cc->links[hlid]; > + while (!cc33xx_is_queue_stopped(cc, wlvif, ac)) { [Severity: Low] Does cc33xx_is_queue_stopped() need to disable IRQs and take cc->cc_lock on every packet? All writers to cc->queue_stop_reasons[] already use atomic bit operations, and cc33xx_is_queue_stopped() drops cc->cc_lock immediately after reading the word, so the lock provides no mutual exclusion with the loop body while adding contention against cc33xx_op_tx(). A lockless READ_ONCE() of cc->queue_stop_reasons[hwq] would suffice here. [ ... ] > + rcu_read_lock(); > + skb =3D ieee80211_tx_dequeue_ni(cc->hw, txq); > + rcu_read_unlock(); > + > + if (!skb) > + break; > + > +try_again: > + ret =3D cc33xx_prepare_tx_frame(cc, wlvif, skb, buf_offset, hlid); [Severity: High] Can releasing rcu_read_lock() before cc33xx_prepare_tx_frame() cause a use-after-free of info->control.hw_key? CPU0 (cc33xx_send_txq_pkts) CPU1 (key removal / rekey) rcu_read_lock() skb =3D ieee80211_tx_dequeue_ni() rcu_read_unlock() ieee80211_key_free() synchronize_net() kfree_sensitive(key) cc33xx_prepare_tx_frame() info->control.hw_key->cipher <-- use-after-free Pointers in skb->cb such as info->control.hw_key are RCU-protected with no reference count, so mac80211 frees the key right after synchronize_net(). The same use-after-free applies to skbs queued on cc->links[hlid].tx_pending (from cc33xx_op_tx() or the -EBUSY fallback) and later passed to cc33xx_prepare_tx_frame() in cc33xx_send_tx_pending_pkts(). > + if (ret =3D=3D -EAGAIN) { > + /* Aggregation buffer is full. > + * Flush buffer and try again. > + */ > + ret =3D cc33xx_tx_buf_write(cc, buf_offset); > + if (ret < 0) { > + ieee80211_return_txq(cc->hw, txq, false); > + return ret; > + } [Severity: Medium] Does this error path leak skb when cc33xx_tx_buf_write() fails? When cc33xx_prepare_tx_frame() returns -EAGAIN, skb has already been dequeued but not yet inserted into cc->tx_frames[], so returning here drops the last reference and even cc33xx_tx_reset() cannot reclaim it. The same leak occurs in cc33xx_send_tx_pending_pkts() on its -EAGAIN flush error path. [ ... ] > +static int cc33xx_send_tx_pending_pkts(struct cc33xx *cc) > +{ > + struct sk_buff *skb =3D NULL; > + int hlid =3D CC33XX_INVALID_LINK_ID; > + struct cc33xx_link *lnk =3D NULL; > + u32 buf_offset =3D 0; > + struct cc33xx_vif *wlvif =3D NULL; > + int ret =3D 0; > + bool tx_allowed =3D true; > + > + for (hlid =3D 0; hlid < CC33XX_MAX_LINKS; hlid++) { > + if (!test_bit(hlid, cc->links_map)) > + continue; > + > + lnk =3D &cc->links[hlid]; > + > + /* First try high prio link, next consider high or low prio link. */ > + for (int prio =3D 0; prio < 2; prio++) { [Severity: Medium] Should the prio loop be outside the hlid loop? With prio nested inside hlid, a lower HLID consumes both its high-priority and low-priority quotas before higher HLIDs are visited at all. If firmware TX buffers fill during prio =3D=3D 1 (-EBUSY), the function returns early a= nd starves higher HLIDs even of their high-priority quota. [ ... ] > + if (!tx_allowed) { > + skb_queue_head(&cc->links[hlid].tx_pending, skb); > + break; > + } [Severity: High] Should CC33XX_FLAG_TX_PENDING be set here before breaking? cc33xx_do_tx_work() clears CC33XX_FLAG_TX_PENDING on entry. When a link hits its per-link threshold while global TX blocks are still available (CC33XX_FLAG_FW_TX_BUSY clear), leaving CC33XX_FLAG_TX_PENDING unset means cc33xx_tx_immediate_complete() will not re-queue cc->tx_work once in-flight frames finish, stalling the remaining tx_pending frames (such as RoC or management frames) until an unrelated TX arrives. [ ... ] > +/* caller must hold cc->mutex and TX must be stopped */ > +void cc33xx_tx_reset(struct cc33xx *cc) > +{ > + int i; > + struct sk_buff *skb; > + struct ieee80211_tx_info *info; [Severity: Medium] Does cc33xx_tx_reset() leave cc->links[hlid].allocated_pkts inflated? In-flight frames freed from cc->tx_frames[] here never decrement allocated_pkts, and neither cc33xx_clear_link() nor cc33xx_cmd_role_start_ap() resets it (cc33xx_turn_off() only zeroes CC33XX_SYSTEM_HLID). After recovery or an AP restart while frames were in flight, stale counts survive on wlvif->ap.global_hlid and wlvif->ap.bcast_hlid, shrinking or blocking their TX flow-control window. [ ... ] > + for (i =3D 0; i < CC33XX_NUM_TX_DESCRIPTORS; i++) { > + if (!cc->tx_frames[i]) > + continue; > + > + skb =3D cc->tx_frames[i]; > + cc33xx_free_tx_id(cc, i); [Severity: Medium] Should cc33xx_tx_reset() also reset cc->last_fw_rls_idx to 0? Commit "wifi: cc33xx: Add init.c, init.h" resets cc->last_fw_rls_idx in cc33xx_hw_init(), but cc33xx_init_fw() enables interrupts before calling cc33xx_hw_init(). If recovery fails during firmware download after IRQs are enabled, process_core_status() sees tx_result_queue_index (0) differ from the stale non-zero last_fw_rls_idx and queues irq_deferred_work. Once recovery exits, cc33xx_tx_immediate_complete() walks up to 107 stale ring entries against the emptied cc->tx_frames[], flooding logs and queueing another recovery on the powered-off device. [ ... ] > + while (!time_after(jiffies, timeout)) { > + cc33xx_debug(cc->dev, DEBUG_MAC80211, "flushing tx buffer: %d %d\n", > + cc->tx_frames_cnt, > + cc33xx_tx_total_queue_count(cc)); > + > + /* force Tx and give the driver some time to flush data */ > + mutex_unlock(&cc->mutex); > + if (cc33xx_tx_total_queue_count(cc)) > + cc33xx_tx_work(&cc->tx_work); > + msleep(20); > + mutex_lock(&cc->mutex); [Severity: Low] Can this msleep(20) polling loop be replaced with a waitqueue or completion? Whenever any frame is in flight or pending, this unconditionally sleeps at least 20 ms with all TX queues stopped and the wiphy lock held, adding latency to scans, channel switches, and key updates even if the frame completes in under a millisecond. [ ... ] > + /* mark all possible queues as awake */ > + for (i =3D 0; i < CC33XX_NUM_MAC_ADDRESSES * NUM_TX_QUEUES; i++) { > + WARN_ON_ONCE(!test_and_clear_bit(reason, > + &cc->queue_stop_reasons[i])); > + } > + > + /* use the global version to make sure all vifs in mac80211 we don't > + * know are woken up. > + */ > + ieee80211_wake_queues(cc->hw); [Severity: Medium] Can cc33xx_wake_queues() resume TX while another stop reason is still active? When configuring a TKIP key, cc33xx_op_set_key() stops queues with CC33XX_QUEUE_STOP_REASON_SPARE_BLK and then calls cc33xx_tx_flush(), which stops and wakes queues with CC33XX_QUEUE_STOP_REASON_FLUSH. Because cc33xx_wake_queues() never checks whether other bits remain set in cc->queue_stop_reasons[], it unconditionally calls ieee80211_wake_queues(), clears CC33XX_FLAG_TX_STOPPED, and schedules cc->tx_work before cc33xx_hw_set_key() updates the firmware key and spare-block count. > + clear_bit(CC33XX_FLAG_TX_STOPPED, &cc->flags); > + > + if (!test_bit(CC33XX_FLAG_FW_TX_BUSY, &cc->flags) && > + test_bit(CC33XX_FLAG_TX_PENDING, &cc->flags)) > + ieee80211_queue_work(cc->hw, &cc->tx_work); [Severity: Medium] Can unsynchronized flag checks across cc33xx_wake_queues(), cc33xx_handle_wake_tx_queue(), and cc33xx_tx_immediate_complete() lose a TX wakeup? CPU0 (cc33xx_handle_wake_tx_queue) CPU1 (cc33xx_wake_queues) ieee80211_wake_queues() test_bit(TX_STOPPED) -> 1 clear_bit(TX_STOPPED) test_bit(TX_PENDING) -> 0 return (no tx_work queued) set_bit(TX_PENDING) <-- wakeup lost cc33xx_handle_wake_tx_queue() checks CC33XX_FLAG_TX_STOPPED and CC33XX_FLAG_FW_TX_BUSY without cc->cc_lock, and cc33xx_wake_queues() calls ieee80211_wake_queues() before clearing CC33XX_FLAG_TX_STOPPED. A similar lost wakeup occurs if cc33xx_tx_immediate_complete() clears CC33XX_FLAG_FW_TX_BUSY while CC33XX_FLAG_TX_STOPPED is set: it skips queueing tx_work without setting CC33XX_FLAG_TX_PENDING, so the subsequent cc33xx_wake_queues() does not schedule tx_work either. [ ... ] > + /* update the TX status info */ > + if (tx_success && !(info->flags & IEEE80211_TX_CTL_NO_ACK)) > + info->flags |=3D IEEE80211_TX_STAT_ACK; > + > + info->status.rates[0].count =3D 1; /* no data about retries */ > + info->status.ack_signal =3D -1; [Severity: High] Does omitting ieee80211_tx_info_clear_status(info) leave unioned control fields in info->status? In struct ieee80211_tx_info, control.jiffies aliases status.rates[] and control.vif aliases status.tx_time, status.flags, and status.link_valid. Because cc33xx sets IEEE80211_HW_HAS_RATE_CONTROL, PS-buffered or filtered frames retain raw jiffies bytes in status.rates[0].idx, which causes sta_set_rate_info_tx() to read past sband->bitrates[] out of bounds when station bitrate is queried. On 64-bit kernels, canonical pointer bytes in control.vif also set IEEE80211_TX_STATUS_ACK_SIGNAL_VALID and corrupt status.tx_time on every completed frame. Calling ieee80211_tx_info_clear_status(info) after inspecting info->control.hw_key (and in cc33xx_tx_reset() and cc33xx_tx_reset_link_queues()) would clear the aliased fields. [ ... ] > + /* remove private header from packet */ > + skb_pull(skb, sizeof(struct cc33xx_tx_hw_descr)); > + > + /* remove TKIP header space if present */ > + if ((cc->quirks & CC33XX_QUIRK_TKIP_HEADER_SPACE) && > + info->control.hw_key && > + info->control.hw_key->cipher =3D=3D WLAN_CIPHER_SUITE_TKIP) { > + int hdrlen =3D ieee80211_get_hdrlen_from_skb(skb); > + > + memmove(skb->data + CC33XX_EXTRA_SPACE_TKIP, skb->data, hdrlen); > + skb_pull(skb, CC33XX_EXTRA_SPACE_TKIP); > + } [Severity: High] Does this leave the unconditional 4-byte IEEE80211_HT_CTL_LEN gap inside every completed skb? cc33xx_prepare_tx_frame() unconditionally adds IEEE80211_HT_CTL_LEN to extra, and cc33xx_tx_fill_hdr() shifts the 802.11 header backward by extra bytes (and shifts skb->network_header forward by extra). Neither cc33xx_tx_complete_packet() nor cc33xx_tx_reset() collapses and pulls that 4-byte gap before returning the skb to mac80211, corrupting management TX status reports, failed BAR parsing, and monitor captures; if mac80211 re-queues a filtered frame, each round-trip also leaks 4 bytes of headroom and can trigger skb_under_panic(). [ ... ] > + /* per link */ > + desc_session_idx =3D le16_get_bits(tx_desc->tx_attr, CC33XX_TX_HW_ATTR_= SESSION_COUNTER); > + > + if (cc->session_ids[tx_desc->hlid] =3D=3D desc_session_idx) > + cc->links[tx_desc->hlid].allocated_pkts--; [Severity: High] Should cc->links[tx_desc->hlid].total_freed_pkts be incremented here? cc33xx_set_key() seeds firmware hardware encryption PN/TSC from cc->links[hlid].total_freed_pkts when reinstalling keys after suspend or recovery, but total_freed_pkts is never incremented anywhere in the driver. As a result, suspend/resume resets the PN to 0 (and recovery only adds 255), causing cryptographic nonce reuse under the same CCMP/GCMP/TKIP key and peer replay-protection drops. [ ... ] > + /* return the packet to the stack */ > + skb_queue_tail(&cc->deferred_tx_queue, skb); > + queue_work(cc->freezable_wq, &cc->netstack_work); [Severity: High] Should cc->netstack_work be queued on cc->freezable_netstack_wq instead of cc->freezable_wq? The RX path in cc33xx_rx_get_packet_data() queues cc->netstack_work on cc->freezable_netstack_wq. Queueing the same work_struct on two different workqueues breaks workqueue non-reentrancy, allowing concurrent execution of cc33xx_netstack_work() (reordering RX skbs), defeating cancel_work_sync(&cc->netstack_work) in cc33xx_turn_off() (risking a use-after-free during teardown), and stalling irq_deferred_work on the max_active=3D1 cc->freezable_wq. [ ... ] > + for (i =3D cc->last_fw_rls_idx; i !=3D tx_result_queue_index; > + i =3D (i + 1) % CC33XX_TX_RESULT_QUEUE_SIZE) { > + ret =3D cc33xx_tx_complete_packet(cc, core_fw_status.tx_result_queue[i= ], > + &core_fw_status); > + } > + > + cc->last_fw_rls_idx =3D tx_result_queue_index; > + > + /* if new mem blocks available and tx was busy or pending, > + * queue the tx work. > + */ > + if (!ret && !test_bit(CC33XX_FLAG_TX_STOPPED, &cc->flags) && > + (tx_busy || test_bit(CC33XX_FLAG_TX_PENDING, &cc->flags))) > + ieee80211_queue_work(cc->hw, &cc->tx_work); [Severity: Low] Should this loop break when cc33xx_tx_complete_packet() returns an error? If an earlier ring entry has an illegal descriptor ID and queues recovery, continuing the loop processes the rest of the corrupted ring and can overwrite ret with 0, causing cc->tx_work to be scheduled despite recovery having been requested. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203070906.1294= 171-1-r-ramalingam@ti.com?part=3D11