From: Heyang Tan <thy15333007817@163.com>
To: linux-wireless@vger.kernel.org
Cc: stf_xl@wp.pl
Subject: [PATCH] wifi: rt2x00: rt61pci: trim RX skb to reported frame length
Date: Mon, 19 Oct 2026 15:33:40 +0800 [thread overview]
Message-ID: <20261019073340.1063-1-thy15333007817@163.com> (raw)
rt61pci_fill_rxdone() reports rxdesc.size from the 12-bit
DATABYTE_COUNT field but, unlike the USB drivers, does not trim the skb
to that length. rt2x00lib_rxdone() then computes the 802.11 header
length from the untrimmed skb and can call rt2x00crypto_rx_insert_iv()
while skb->len does not match rxdesc.size.
Trim the skb at the end of rt61pci_fill_rxdone(), matching rt2500usb and
rt73usb, so the skb length is correct before the header length is
computed and before any IV/ICV data is reinserted.
Signed-off-by: Heyang Tan <thy15333007817@163.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
drivers/net/wireless/ralink/rt2x00/rt61pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
index d4783658b..bc0fb3cf9 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
@@ -2051,6 +2051,7 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry,
rxdesc->dev_flags |= RXDONE_SIGNAL_BITRATE;
if (rt2x00_get_field32(word0, RXD_W0_MY_BSS))
rxdesc->dev_flags |= RXDONE_MY_BSS;
+ skb_trim(entry->skb, rxdesc->size);
}
/*
--
2.34.1
next reply other threads:[~2026-10-19 7:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 7:33 Heyang Tan [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-16 3:57 [PATCH] wifi: rt2x00: rt61pci: trim RX skb to reported frame length Heyang Tan
2026-10-16 7:28 ` Stanislaw Gruszka
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=20261019073340.1063-1-thy15333007817@163.com \
--to=thy15333007817@163.com \
--cc=linux-wireless@vger.kernel.org \
--cc=stf_xl@wp.pl \
/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