Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5671231rwb; Wed, 7 Sep 2022 06:27:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5rud0LW3GeomkCz6M+z41qrmyslr6/tUj23oWpSuM98dObYi7akn+7u5QqkJ77hNq0ycfX X-Received: by 2002:a63:8848:0:b0:434:b5d7:b4fa with SMTP id l69-20020a638848000000b00434b5d7b4famr3352750pgd.181.1662557246605; Wed, 07 Sep 2022 06:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662557246; cv=none; d=google.com; s=arc-20160816; b=C/pA8F0OHU9/SR9oG/T5pQ6HAIE3/uAaV1vkHxKMWUU2oZ9uy+7phjrA7FpWvnzSc4 wg2uX9UzRLvUwi+4LMC14K5P0WrJdbIlRJSFDcaUVFqSsMLaLeXv3wF1td85uVsCJy5j nT89rkeJ+jdxral2MJ+P4yeH93HNNtuA7GKngxSXuBhWjpvuEkS0wvWL48bCsuyTmaE4 AmR7rV1ukPT+XMM6yBBI0xt1zpRzOZZ4FmUo75x6TJofGgH+8MaKPBTnvqrqh2KmVOVj CXJs44l0uPchPLcc9cVZYpcivjBflpi0FmuGG9LBv2n3OIGcQgwO6988ohwPdlsm3nME 6Vmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K10uAJSt1u89AHdHDm3QcGmANMSoQ/8HY7X6zX3XZWE=; b=yqMFO8Z+kAlpy/IYnJ+xdsQfV1I/osj/ARQl8ToqB7jHBKyIC4ZPsrhx9bRVWTGmUf 7+o97g2g8bKgr1xUoJcrHM4E/My4HjouJ7uGHMtxblmd+fwl3LRE9rndedmKXNkdPX08 hOuvIspGo6OQMYYxAimjsjMqz2R1HT57kTjgZs8o/6P8E3AOY+gs6Pa/5hly+er0Sz5H UAGfCKWHcbAE9MH1BKMpSiN9kpVqMnucqJ1EEJG0NHwNKNivJ1cqkq1NvNtfAU+Qyx/P iPNUG3TNoyV3OumKdxgNOdBK7oBCYdxnT7Dxt7Ukh2St2HhlF5YpoOGEfHsxI19FB0Ls Hypg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=zebyzyv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a170903024700b001733c2e2284si934698plh.426.2022.09.07.06.27.12; Wed, 07 Sep 2022 06:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=zebyzyv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbiIGMvb (ORCPT + 99 others); Wed, 7 Sep 2022 08:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiIGMvY (ORCPT ); Wed, 7 Sep 2022 08:51:24 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 209D375CE9 for ; Wed, 7 Sep 2022 05:51:21 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id bp20so19751824wrb.9 for ; Wed, 07 Sep 2022 05:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=K10uAJSt1u89AHdHDm3QcGmANMSoQ/8HY7X6zX3XZWE=; b=zebyzyv5uKr+UqsozuiNEURIYqvNSEMx/k5mlK+LX3bAhdI2PaQP2VCIgM9lmXtdeo JkMS58BTcZhx+QgoTSa9bOMHDIujGKqs6m3ZQKBtUJDMNicEjA07WZN/Qh0PJA9TYhpd 3fcOrWd2LJJY/CeIk+4iQRL3yQ4nz7ws8FLReQL++JjQuPsCoS83B8l6ZERbys591+XP NC6/iLKXCGyqblLuTPfA/r/cjJFcoavZ/Gj6P1w4ROG8A8ZzO2dl3COIE1A/XUjRwMGD wZuy80hJFk+2Pq1ZHJc7wbkRe7TCJY9uN933qBYe0FGW8IxV/hOy93L43ghqQBxlx1sU mo/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=K10uAJSt1u89AHdHDm3QcGmANMSoQ/8HY7X6zX3XZWE=; b=xz1yH5oxJAw+8YessOiH6/Ow4+NYZKKtFABpVS4K061HbWEsXu1JbSFgq7Jx3m4poO 0vOZqTTAvdO4e8tmhipGTdguzY6NQcNwE2HjpeBgm9ZNd401ubLsVhoaZ2Eiqy/5vzF+ TBOYA4/RqU1QubVv+xNHAskdF1NeQVPiKhYlmdNX+ObLd3su6rIEaUaTTRmhskARP1QO rW/4k+OReazrL6chQRzPa9iYfqx8cY9TaKAbScJnyg8Sb7Ae7qeGO8rbB7ESZqBr2aRJ EAFQX5rjhRt9JNrGGoPCplLE/AdqivnH3luX9CuRvWjyg97ob8/F03eUlhvzziIbrLtv KPig== X-Gm-Message-State: ACgBeo0BLno275sshmm2IA04CuTuRE6/j+PTCRezJgpHwF8ko/ycrgid VLmzGU4CMif6saua22h4KWTFow== X-Received: by 2002:a5d:588b:0:b0:227:1c28:f470 with SMTP id n11-20020a5d588b000000b002271c28f470mr2105741wrf.331.1662555079421; Wed, 07 Sep 2022 05:51:19 -0700 (PDT) Received: from navi.cosmonova.net.ua ([95.67.24.131]) by smtp.gmail.com with ESMTPSA id e27-20020adf9bdb000000b0021f0ff1bc6csm11480001wrc.41.2022.09.07.05.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:19 -0700 (PDT) From: Andrew Melnychenko To: edumazet@google.com, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, jasowang@redhat.com, mst@redhat.com, pabeni@redhat.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org Cc: yan@daynix.com, yuri.benditovich@daynix.com Subject: [PATCH v3 1/6] udp: allow header check for dodgy GSO_UDP_L4 packets. Date: Wed, 7 Sep 2022 15:50:43 +0300 Message-Id: <20220907125048.396126-2-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Packets from TAP devices with USO offload converts to GSO_UDP_L4 & GSO_DODGY sk buffers. Added changes allow skipping segmentation for DODGY/ROBUST packets. Signed-off-by: Jason Wang Signed-off-by: Andrew Melnychenko --- net/ipv4/udp_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 6d1a4bec2614..8e002419b4d5 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -387,7 +387,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, if (!pskb_may_pull(skb, sizeof(struct udphdr))) goto out; - if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) + if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 && !skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) return __udp_gso_segment(skb, features, false); mss = skb_shinfo(skb)->gso_size; -- 2.37.2