RE: [PATCH rtw-next v2] wifi: rtw89: update PN state only from correctly decrypted frames
From: Ping-Ke Shih
Date: Mon Nov 16 2026 - 04:25:47 EST
Zhao Li <enderaoelyther@xxxxxxxxx> wrote:
> rtw89_core_skb_pn_valid() records the sequence and packet numbers of
> hardware-decrypted QoS data frames so that it can drop frames whose
> sequence number goes backwards while the PN advances. It runs before
> mac80211 discards frames with an ICV/MIC or FCS error and requires only
> hw_dec, so a frame that failed decryption still updates last_sn and
> last_pn. Such a frame need not come from the peer. One with an advanced
> sequence number and a PN between the recorded PN and the peer's next
> one makes the check drop the peer's following valid frames until their
> sequence numbers catch up.
>
> Skip frames that rtw89_core_update_rx_status() does not report to
> mac80211 as decrypted, or reports with an FCS error.
>
> Found by code review and not reproduced; compile-tested only.
>
> AI assistance was used.
>
> Fixes: bda294ed0ed0 ("wifi: rtw89: Drop malformed AMPDU frames with abnormal PN")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Zhao Li <enderaoelyther@xxxxxxxxx>
Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>