Received: by 10.213.65.68 with SMTP id h4csp1720542imn; Mon, 19 Mar 2018 11:23:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELs9aRv/6hmRQKyp8GkebgFKkmoVqqBGMpSueSnPcOXxr5P/wqfbh4nc/M05Ui3wdXratWL2 X-Received: by 2002:a17:902:a607:: with SMTP id u7-v6mr13329537plq.367.1521483818442; Mon, 19 Mar 2018 11:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483818; cv=none; d=google.com; s=arc-20160816; b=BjQrId6wDKOQex1+G7uYKz0IqnniYdKidNYy+4zJOG/bhjK7fmhhFFWLSi7hxu+vgG 9gUBAfKh4kP4VTwaYjcZT6pX6NOrw38aiuh/mFYqQiPVEuzFTq+Eosn0xVHaBNb+jPum y8MKX1RLe471R12t+bRovoNhsYWWBRmZNLNtoeTAmEOIh8mtT5q5IF3BfeSdINfwi4Zh Y8B4Vsl3HcMRekXoM0n7d9KHOHqQAw2CBz2b5yHFJE/AlStldpniCdveUCfuL4XgRGXg 5Ue1GLn2UyzKYTlvF4a2Zybe54XH+wIcRjpBt8RqMuEVybaw9Rf/n7szUHucVvkTUQvM DMVQ== 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=PKtOp/wfoMbARtH4Cgrn9iL30G3pXV6ypDo7L08T/Cg=; b=V62ZacFH8Vu43b9wpTibFtxkuXRHs0YirBgitYqKumOJtA0OQMsE+kwOKrVClFDWBS SptTelcSC3VAxLcoacv+kDzqfLAuQRN/YYdZt4T1Wej6LtVJCwJcQCsi0eCVzzuhkI1h d0dwwt0eohpyif5At7pAUKovNcpIvnl+5dJAsW02Wh9JD3P6g93MGsTSpyBKWoFEAxCs dl/Aw1T+1JqIzwqDRcFMOUeyDOkjsnct8P5mEfKuwTJxO5a2Bl5aFOBzqsFLYxXF7wnS EcE/ROdSOEnPncToN5piBOhafBSjzmleg67K+NPKAusrggoGPVsJc15p+Typx2HKi5z7 5g6Q== 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 d14-v6si413381plj.191.2018.03.19.11.23.24; Mon, 19 Mar 2018 11:23:38 -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 S966486AbeCSSUl (ORCPT + 99 others); Mon, 19 Mar 2018 14:20:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969529AbeCSSUe (ORCPT ); Mon, 19 Mar 2018 14:20:34 -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 E88A111CD; Mon, 19 Mar 2018 18:20:33 +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.9 059/241] sched: act_csum: dont mangle TCP and UDP GSO packets Date: Mon, 19 Mar 2018 19:05:24 +0100 Message-Id: <20180319180753.649869136@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -180,6 +180,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; @@ -201,6 +204,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; @@ -224,6 +230,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, @@ -277,6 +286,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,