From: Ping-Ke Shih <pkshih@realtek.com>
To: Luka Gejak <luka.gejak@linux.dev>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Ulf Hansson <ulfh@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Kalle Valo <kvalo@kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH rtw-next] wifi: rtw88: sdio: reject oversized RX packets
Date: Mon, 12 Oct 2026 01:53:17 +0000 [thread overview]
Message-ID: <13bac899a2ea49d28dcbd4a8c765f3ca@realtek.com> (raw)
In-Reply-To: <20261009123022.87787-1-luka.gejak@linux.dev>
Luka Gejak <luka.gejak@linux.dev> wrote:
> --- a/drivers/net/wireless/realtek/rtw88/sdio.c
> +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
> @@ -1389,6 +1389,14 @@ static void rtw_sdio_rxfifo_recv(struct rtw_dev *rtwdev, u32 rx_len)
> curr_pkt_len = ALIGN(pkt_offset + pkt_stat.pkt_len,
> RTW_SDIO_DATA_PTR_ALIGN);
>
> + if (unlikely(pkt_offset + pkt_stat.pkt_len > rx_len)) {
Can you use real hardware to test this patch to see if there is actual case
falling into this branch? (see below)
> + rtw_dbg(rtwdev, RTW_DBG_SDIO,
> + "oversized RX packet: %u, %u bytes left\n",
> + pkt_offset + pkt_stat.pkt_len, rx_len);
> + dev_kfree_skb_any(skb);
> + return;
> + }
> +
> if ((curr_pkt_len + pkt_desc_sz) >= rx_len) {
Because I wonder if this condition is right? In my perspective, the
curr_pkt_len = pkt_offset + pkt_stat.pkt_len + align_bytes
= pkt_desc_sz + ... + pkt_stat.pkt_len + align_bytes
Why does the if-condition plus pkt_desc_sz twice and compare with rx_len?
However, it should enter to handle/free the last aggregated packet.
Can you enlighten me how it looks like that?
> /* Use the original skb (with it's adjusted offset)
> * when processing the last (or even the only) entry to
> --
> 2.55.0
next prev parent reply other threads:[~2026-10-12 1:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 12:30 [PATCH rtw-next] wifi: rtw88: sdio: reject oversized RX packets Luka Gejak
2026-10-12 1:53 ` Ping-Ke Shih [this message]
2026-10-12 6:29 ` Luka Gejak
2026-10-12 8:07 ` Ping-Ke Shih
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=13bac899a2ea49d28dcbd4a8c765f3ca@realtek.com \
--to=pkshih@realtek.com \
--cc=jernej.skrabec@gmail.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luka.gejak@linux.dev \
--cc=martin.blumenstingl@googlemail.com \
--cc=stable@vger.kernel.org \
--cc=ulfh@kernel.org \
/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