Re: [PATCH ath-next 1/3] wifi: wcn36xx: set RX decryption flags only on encrypted data frames

From: Loic Poulain

Date: Mon Nov 30 2026 - 04:00:21 EST


On Sun, Nov 29, 2026 at 12:32 AM Vladimir Bely <vlwwwwww@xxxxxxxxx> wrote:
>
> wcn36xx_rx_skb() unconditionally sets RX_FLAG_IV_STRIPPED,
> RX_FLAG_MMIC_STRIPPED, and RX_FLAG_DECRYPTED on every received frame,
> regardless of whether hardware decryption actually took place.
>
> This causes two issues:
> - Management frames (which WCNSS firmware delivers untouched with
> bd->dpu_ne == 1 when rmf == 0) are falsely marked as decrypted,
> preventing mac80211 from performing software decryption/MIC
> verification on robust management frames and bypassing
> ieee80211_drop_unencrypted_mgmt().
> - Unencrypted data frames such as 4-way handshake EAPOL frames
> (fc 0x0288), where WCN3620 hardware leaves bd->dpu_ne == 0, are
> falsely reported as decrypted and bypass ieee80211_drop_unencrypted().

Does this cause any user-visible issues, such as connection problems?
Should we consider it for stable, with a Fixes tag.

>
> Only set the hardware decryption flags when bd->dpu_ne is clear, the
> frame is not a management frame, and IEEE80211_FCTL_PROTECTED is set in
> the 802.11 header (verified on WCN3620 that hardware preserves the
> Protected bit on both CCMP and TKIP hardware-decrypted data frames).
>
> Signed-off-by: Vladimir Bely <vlwwwwww@xxxxxxxxx>
> ---
> drivers/net/wireless/ath/wcn36xx/txrx.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c
> index 882699879..a554c59de 100644
> --- a/drivers/net/wireless/ath/wcn36xx/txrx.c
> +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c
> @@ -355,9 +355,11 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
> status.antenna = 1;
> status.flag = 0;
> status.rx_flags = 0;
> - status.flag |= RX_FLAG_IV_STRIPPED |
> - RX_FLAG_MMIC_STRIPPED |
> - RX_FLAG_DECRYPTED;
> + if (!bd->dpu_ne && !ieee80211_is_mgmt(hdr->frame_control) &&
> + ieee80211_has_protected(hdr->frame_control))
> + status.flag |= RX_FLAG_IV_STRIPPED |
> + RX_FLAG_MMIC_STRIPPED |
> + RX_FLAG_DECRYPTED;
>
> wcn36xx_dbg(WCN36XX_DBG_RX, "status.flags=%x\n", status.flag);
>
> --
> 2.43.0
>