Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1778433imm; Thu, 27 Sep 2018 02:18:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV620hxMQ83xponHBiodEyomyfiB0cVEpSAiUWb3/bp6RMBO6SMwAmol2nTAAPaZYFYttQt7+ X-Received: by 2002:a62:b40c:: with SMTP id h12-v6mr10410457pfn.18.1538039930359; Thu, 27 Sep 2018 02:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039930; cv=none; d=google.com; s=arc-20160816; b=q/vNAXeL03ZnotToOY1fnZBM8HBTDYzAJa/94nVw7u9Ny+9MQL6zqUf5rLuNzxCkhS p7yQFuLRfDcnJ7QdeKr5ttYGJi/RW02Kyk1h5BCkVxJvr0H8QwLPaY0v2hUzFouh3Q0I 7Qan3I7wfAQALHXEGmQr1kifIWC/rFXvAZLdydO28NfVc9FpmlSLwj4diFOhant4/nD6 bHagT6lUI6lIqp0TX8jOjRB/eEEuUDTM+4te449oB7mwqQnOP7yyzgyqTTdqedUCnIcn Zc6Q2CuYdgCTRhYKhvKUgbKnVn6rsPkjFviQHeiJQAHWJO88TA3yIAesJZFuyqD+BRcX BKuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=P0v4USFA4kmzKJxkJ60n1Nnxb8ZN9tmaUqVB5rQJG4U=; b=ZGBxctETz6Nqa8ZdNjFuWByVi3z4+KDjweOjJD4GnxVkzuPHHs8prSNxI0VAdfMjFR 0CjxNEmn1eHlcJAw+FYy2U8Ir7OiNzPQGN54cWIklVoKaCewlp51L9p3uOsEqjXqcroV sr/XUE98qHpWiuf1qiwnImFe6UNgJEzW+8hhk2HHt5Ccn74s8NJ5Uymi0TeA7vRMwzRT gGBisRIGX/K/lBlkm7ch2DnX/SQ0JzwF6fnHFXiQWiUKcX8NUf+V60CiU9qq+8rNSpeA e7jI/uNvxjNHwVHF2tvpIQad+BpFT1agxUvH/vU3MnyBBHBDREAq6y7aC+oEILHIf9FE Ag9A== 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 h9-v6si1650916plk.461.2018.09.27.02.18.34; Thu, 27 Sep 2018 02:18:50 -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 S1728819AbeI0Pdt (ORCPT + 99 others); Thu, 27 Sep 2018 11:33:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55890 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727271AbeI0Pds (ORCPT ); Thu, 27 Sep 2018 11:33:48 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C7DF11120; Thu, 27 Sep 2018 09:16:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Taht , Eric Dumazet , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , "David S. Miller" Subject: [PATCH 4.14 01/64] gso_segment: Reset skb->mac_len after modifying network header Date: Thu, 27 Sep 2018 11:03:18 +0200 Message-Id: <20180927090250.001345435@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090249.801943776@linuxfoundation.org> References: <20180927090249.801943776@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Toke H?iland-J?rgensen" [ Upstream commit c56cae23c6b167acc68043c683c4573b80cbcc2c ] When splitting a GSO segment that consists of encapsulated packets, the skb->mac_len of the segments can end up being set wrong, causing packet drops in particular when using act_mirred and ifb interfaces in combination with a qdisc that splits GSO packets. This happens because at the time skb_segment() is called, network_header will point to the inner header, throwing off the calculation in skb_reset_mac_len(). The network_header is subsequently adjust by the outer IP gso_segment handlers, but they don't set the mac_len. Fix this by adding skb_reset_mac_len() calls to both the IPv4 and IPv6 gso_segment handlers, after they modify the network_header. Many thanks to Eric Dumazet for his help in identifying the cause of the bug. Acked-by: Dave Taht Reviewed-by: Eric Dumazet Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/af_inet.c | 1 + net/ipv6/ip6_offload.c | 1 + 2 files changed, 2 insertions(+) --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1307,6 +1307,7 @@ struct sk_buff *inet_gso_segment(struct if (encap) skb_reset_inner_headers(skb); skb->network_header = (u8 *)iph - skb->head; + skb_reset_mac_len(skb); } while ((skb = skb->next)); out: --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c @@ -113,6 +113,7 @@ static struct sk_buff *ipv6_gso_segment( payload_len = skb->len - nhoff - sizeof(*ipv6h); ipv6h->payload_len = htons(payload_len); skb->network_header = (u8 *)ipv6h - skb->head; + skb_reset_mac_len(skb); if (udpfrag) { int err = ip6_find_1stfragopt(skb, &prevhdr);