From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74F33C531CB for ; Thu, 23 Jul 2026 09:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=FF3CQzDN2xFla8uEGiPnMoAn7bZknuWf8Lkei7xVdww=; b=hQn7faQ/a3wKHx+4/vOk822jdf YXacIyTmPeElNhlgaRbWjT0w6sWVQr/K6Vrp5HVtvLPjpDYw0gh18rFiVv/i52pqRwFe3GYJDfT36 WB6+nQQM2XyjmbMxYZSmYscWpoDRv9EI7GXhdAZEmGYUe3teOl/AyAnNZLVX0uzLzUGS+KZO5v9Nz 8e/l+pFMTL6+8lVBVIGE6AtAW79K0mGtQlSoMEOV3+98kRuVm57zj1XVHq9TG+HjDDF8+UlUZtXnM x6hUZKvDFRaZS49U0cF7VvQie+DDtXy2wDAvMcaFSTWD6/T0uz/9izOoq/CMiQzycRFkg8BCqL1a3 moQi/sPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmpXO-0000000DpS0-0A0Y; Thu, 23 Jul 2026 09:16:18 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmpXL-0000000DpQU-1KRJ; Thu, 23 Jul 2026 09:16:16 +0000 X-UUID: 23db11cc867711f1acbe4559397dec65-20260723 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=FF3CQzDN2xFla8uEGiPnMoAn7bZknuWf8Lkei7xVdww=; b=rJRf+0q3Wg7NVFVGhL5r+U2UFGGdy4CAWJKBVXNU+COj2vLdPvVruSoJ1mRsUm6z8xYIKkPaZAfCIPAt47STz4TDovz5GRp2LPJ1LTrCRg+IoBT9Pfi4y3lSvScpl3OHTaESPKX30lHuTKqW4u6Zb2lSCIcqwQ8Ls7RmEaFiDck=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.18,REQID:370618f0-8a66-43a6-8de7-eb915bedca5e,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:8a735a6,CLOUDID:164d3754-ba59-46c6-b844-86065e9edbd3,B ulkID:nil,BulkQuantity:0,SF:102|123|836|865|888|898,TC:-5,Content:0|15|50| 99|100|101|123,EDM:-3,IP:nil,URL:1,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_ULS,TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 23db11cc867711f1acbe4559397dec65-20260723 Received: from mtkmbs09n1.mediatek.inc [(172.21.101.35)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 43664947; Thu, 23 Jul 2026 02:16:08 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Thu, 23 Jul 2026 17:16:06 +0800 Received: from mcddlt001.gcn.mediatek.inc (10.19.240.15) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Thu, 23 Jul 2026 17:16:04 +0800 From: To: , , , , , , , , , , , , , , , , , , CC: , , , , Zhaoping Shu Subject: [PATCH net v2] net: gro: avoid nesting TCP GSO skbs in skb_gro_receive_list() Date: Thu, 23 Jul 2026 17:16:01 +0800 Message-ID: <20260723091601.72103-1-zhaoping.shu@mediatek.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260723_021615_381094_40EE8BDF X-CRM114-Status: GOOD ( 10.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: HW He On devices that support both NETIF_F_GRO_HW and NETIF_F_GRO_FRAGLIST, the hardware or driver may deliver packets that have already been aggregated into a TCP GSO skb with frags[]. GRO may then aggregate the skb again in skb_gro_receive_list(). This can create a nested GSO skb, which is not handled correctly by the later GSO segmentation paths. When the skb is segmented by skb_segment_list(), it not be fully restored to the original packets. Avoid this by setting NAPI_GRO_CB(skb)->flush for GSO skbs before aggregation. Signed-off-by: HW He Signed-off-by: Zhaoping Shu --- v2: Take Antoine Tenart's suggestion v1: https://lore.kernel.org/netdev/amB7wb1A2Oo2dv5d@kwain/ --- 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 3b1fdcd3cb29..c363434a5646 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c @@ -332,6 +332,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb, flush |= skb->ip_summed != p->ip_summed; flush |= skb->csum_level != p->csum_level; flush |= NAPI_GRO_CB(p)->count >= 64; + NAPI_GRO_CB(skb)->flush |= skb_is_gso(skb); skb_set_network_header(skb, skb_gro_receive_network_offset(skb)); if (flush || skb_gro_receive_list(p, skb)) -- 2.17.0