Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1772584imm; Thu, 27 Sep 2018 02:12:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV62d4BZAjwA9vy0bcm5K433ya8vRlqziTIQo+8mJx9EcpH78+e7FEyRCfqmQTphs3DkIsBum X-Received: by 2002:a63:2541:: with SMTP id l62-v6mr9079838pgl.343.1538039252726; Thu, 27 Sep 2018 02:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039252; cv=none; d=google.com; s=arc-20160816; b=mNMmNWHSzvEMsKKEHi2aTZsRWo/oZp1YPFnX+hR+tzDXyA1UyazTyubjLmAiPSXoR7 V26gaL1LXytaBSEjP03zsUc8j/4stvWt6prrvuK7SUoeYLeTGfXbIXBO2rea8l6lRsAi y7Dj4Qx6y5H0ueHLRt9qK1egee8JrQ2iGSUkpO7JiZt+mnn8+xQy5/bkI9pSLmg1jILt Z4SShqEOZeUCji5LMJmLXcTP/4ni/4hx9UI8C40idgURRBgqLSU99AhgTt/gL9oPv+rg V6bLLEI/UlgGn8aw/qGVhUwUE8S2hwgydiUoCzElbCbgWsvAq77ClZDlZL+rArrgY3Tg Y2ZA== 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=UYV20bH9URdDviJHMVxhDZAhcFe9g1WlF7RKXwlvfho=; b=s2cNcufMeU4JTBG12Iwo+sE1/uecu92/uV5riLzdy2DJwIgFSr0x+fjuYQYmdBv2SV vOpMTAZKyJkLOMYXuEA0p9EAheAzBjO/zWa01sryXZER4OdfqBVM653YTXZ2iMi3Zvv6 KW5jmdxg7txinGNwuakrOZ6S68Sn1oBWZk6+GqOoP/EP8IaMxksQ7Ww9dwgMcKiUPBvc Ljs1kJyTiGVZc/Q7MJJmd5XfwvXRoY5OECzpi+U7FnwjnSbui2UCQyEesyT3odMxKFu7 rS+A9VKO4pKUzil640ys3fPqZQnnA0VTaNG7YPvWWqP0nHrpupajCFeq1jhT8gPwP9nb qWqg== 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 c5-v6si1359879pgw.343.2018.09.27.02.07.17; Thu, 27 Sep 2018 02:07:32 -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 S1727295AbeI0PYU (ORCPT + 99 others); Thu, 27 Sep 2018 11:24:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54706 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbeI0PYU (ORCPT ); Thu, 27 Sep 2018 11:24:20 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B2B2D10C8; Thu, 27 Sep 2018 09:07:05 +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.18 01/88] gso_segment: Reset skb->mac_len after modifying network header Date: Thu, 27 Sep 2018 11:02:42 +0200 Message-Id: <20180927090300.788614977@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@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.18-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 @@ -1377,6 +1377,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 @@ -115,6 +115,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);