From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Suman Ghosh <sumang@marvell.com>, Felix Fietkau <nbd@nbd.name>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [EXTERNAL] [PATCH net-next] net: add missing check for TCP fraglist GRO
Date: Tue, 07 May 2024 07:51:13 -0400 [thread overview]
Message-ID: <663a15b153de_726ea29475@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <SJ0PR18MB521604310B1F7DC297C2870DDBE42@SJ0PR18MB5216.namprd18.prod.outlook.com>
Suman Ghosh wrote:
> >----------------------------------------------------------------------
> >It turns out that the existing checks do not guarantee that the skb can be
> >pulled up to the GRO offset. When using the usb r8152 network driver with
> >GRO fraglist, the BUG() in __skb_pull is often triggered.
> >Fix the crash by adding the missing check.
> >
> >Fixes: 8d95dc474f85 ("net: add code for TCP fraglist GRO")
> [Suman] Since this is a fix, this should be pushed to "net".
The referenced patch has only landed in net-next yet.
> >Signed-off-by: Felix Fietkau <nbd@nbd.name>
Reviewed-by: Willem de Bruijn <willemb@google.com>
> >---
> > net/ipv4/tcp_offload.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index
> >c90704befd7b..a71d2e623f0c 100644
> >--- a/net/ipv4/tcp_offload.c
> >+++ b/net/ipv4/tcp_offload.c
> >@@ -353,6 +353,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head,
> >struct sk_buff *skb,
> > flush |= (__force int)(flags ^ tcp_flag_word(th2));
> > flush |= skb->ip_summed != p->ip_summed;
> > flush |= skb->csum_level != p->csum_level;
> >+ flush |= !pskb_may_pull(skb, skb_gro_offset(skb));
> > flush |= NAPI_GRO_CB(p)->count >= 64;
The same check already exists in udp_gro_receive, which has for longer
been calling skb_gro_receive_list:
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return NULL;
}
Alternatively it would make sense to deduplicate the check and move it
to skb_gro_receive_list itself, before
skb_pull(skb, skb_gro_offset(skb));
next prev parent reply other threads:[~2024-05-07 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 9:41 [PATCH net-next] net: add missing check for TCP fraglist GRO Felix Fietkau
2024-05-07 11:33 ` [EXTERNAL] " Suman Ghosh
2024-05-07 11:43 ` Felix Fietkau
2024-05-07 11:57 ` Suman Ghosh
2024-05-07 11:51 ` Willem de Bruijn [this message]
2024-05-07 12:08 ` Eric Dumazet
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=663a15b153de_726ea29475@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sumang@marvell.com \
--cc=willemb@google.com \
/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