Received: by 10.213.65.68 with SMTP id h4csp1714792imn; Mon, 19 Mar 2018 11:14:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELt3nlIPloKjxDMdvYJKbBtn1F0pddz95iB9z7ljXXW35QQqdmdvvHvIOxyag7hN/I2pl+4A X-Received: by 2002:a17:902:ac96:: with SMTP id h22-v6mr13181755plr.93.1521483287196; Mon, 19 Mar 2018 11:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483287; cv=none; d=google.com; s=arc-20160816; b=ciXvwDgXkn5w8J0bGVhKw47ZHeNoB6rzUmw2xa5IHvKXPDODkrN9dYV9QdWfT2tGZc z3BMKd8CI49UPO6JiJe2JvfbUJZxNUURTtH38Oj4T8/ha3V6Di+hEfR8uTfe153VIaPS zTvbzTmyqXHaIhUYk4Z5RbaLqT14+OgT2rsbeGbQx4SfHqTOBjc8//2BvtxPPdZuJI5Y +Eh762zlsp97768uoCOGwUqLELLtaCgqXMbUyb3R7UygKA8Vw4pPUsTUdlvQeItumpW5 w1nv27TroLHs0iuyu5tRhtQWTahiNCXa0us/CEjgU1zwo6kYDc0VyIHP4e2gZoozkc4e bKXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ypSQPiRC6lAWnx66fPeGlz2N3rI369ywyMRbl7Z20pM=; b=qvBcQjZeUvTiOb+NbURmrbkr2ZGFpBqC9JZddCrQAwT8hwi5ZPaWNZ03ce2/N6OlDR 99CV+40ZwJcJJNqHfe+BWHMjZuMSnDP5BqXl44EWonSd+Fhw2Df8fIwNDZ1EFuz6rHgM +n+F3pCyHOMQI89wG9C9frBdMxm5jz0N1OKSDvy2aUL6qbfRGHYNSCqpZT77i6sQIchR GJWe0/A8v48Wun+r2D3IMA1p1lPcE5P01wgCorP3fqVBSKy1vPckpk04fYDiX69whzJR jjk7ihgAuIqbMntGwA3L7e0WOeOPl3UI9L8k5lx1cM/ETwtSKGffkmMXY7IOv0smiZQw C3sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si304678pgr.164.2018.03.19.11.14.32; Mon, 19 Mar 2018 11:14:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030554AbeCSSNU (ORCPT + 99 others); Mon, 19 Mar 2018 14:13:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43014 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030465AbeCSSNI (ORCPT ); Mon, 19 Mar 2018 14:13:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9809911D6; Mon, 19 Mar 2018 18:13:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davide Caratti , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 030/134] sched: act_csum: dont mangle TCP and UDP GSO packets Date: Mon, 19 Mar 2018 19:05:13 +0100 Message-Id: <20180319171853.609141589@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Davide Caratti [ Upstream commit add641e7dee31b36aee83412c29e39dd1f5e0c9c ] after act_csum computes the checksum on skbs carrying GSO TCP/UDP packets, subsequent segmentation fails because skb_needs_check(skb, true) returns true. Because of that, skb_warn_bad_offload() is invoked and the following message is displayed: WARNING: CPU: 3 PID: 28 at net/core/dev.c:2553 skb_warn_bad_offload+0xf0/0xfd <...> [] skb_warn_bad_offload+0xf0/0xfd [] __skb_gso_segment+0xec/0x110 [] validate_xmit_skb+0x12d/0x2b0 [] validate_xmit_skb_list+0x42/0x70 [] sch_direct_xmit+0xd0/0x1b0 [] __qdisc_run+0x120/0x270 [] __dev_queue_xmit+0x23d/0x690 [] dev_queue_xmit+0x10/0x20 Since GSO is able to compute checksum on individual segments of such skbs, we can simply skip mangling the packet. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/sched/act_csum.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -175,6 +175,9 @@ static int tcf_csum_ipv4_tcp(struct sk_b struct tcphdr *tcph; const struct iphdr *iph; + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) + return 1; + tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); if (tcph == NULL) return 0; @@ -196,6 +199,9 @@ static int tcf_csum_ipv6_tcp(struct sk_b struct tcphdr *tcph; const struct ipv6hdr *ip6h; + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) + return 1; + tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); if (tcph == NULL) return 0; @@ -219,6 +225,9 @@ static int tcf_csum_ipv4_udp(struct sk_b const struct iphdr *iph; u16 ul; + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) + return 1; + /* * Support both UDP and UDPLITE checksum algorithms, Don't use * udph->len to get the real length without any protocol check, @@ -272,6 +281,9 @@ static int tcf_csum_ipv6_udp(struct sk_b const struct ipv6hdr *ip6h; u16 ul; + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) + return 1; + /* * Support both UDP and UDPLITE checksum algorithms, Don't use * udph->len to get the real length without any protocol check,