Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1820942imm; Mon, 3 Sep 2018 10:17:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ356ykz6ZZ2u/hPk57cwhcukY2TP1s8nG9QOBTJw3gjP7gxlDS2ga08fcxJu2zS1mu0sWJ X-Received: by 2002:a17:902:4381:: with SMTP id j1-v6mr16141907pld.227.1535995032605; Mon, 03 Sep 2018 10:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995032; cv=none; d=google.com; s=arc-20160816; b=VnD00VZEI5uOa8CfnCDzUa8LL6to/87ddTWWFzjYa7JeEan9/pK5K/z67tVFIbY3GJ KSHMXMGhx8Pg16g7Ut5kJBP4sBeFuwt5C6c+Y1+UfUXphdts9r+nRtHKoksj7NonX+Eu oT8q+vSprpwM4TU4ic0RnwAClEdVOmdEGQra6PPSi8trz37vdbnhUEhmbSmuYcPLgnUd Yu61kKa7dTEP6V6q5NOq+I+hwFUkNX/m8QYAPgYQzP5dEJt4wJdul/kmItLdygynn0hU X2Uhs4eHxlqVIEh+fkfsgLUDc68BeUDYPykZQqBHXa2MFsIWOKZ/fPEwhHnT1Yh3Kf0y vbPA== 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=EXWweAcfgvPnglgO8akPuMGYLsBhfUpOhtaBQlHnSyU=; b=NimMqIv0HTQHVpeml0gYbBRWYfhxIJPOd7K4JRFgVwFkuwun7S5/nQ1F+9IpLcpW7F CAF7A/uXWKXR5cx9TKYSxH5Z4KHhavD8y1k+BQciUTicANYZj4eafkZBD2NcyxTTwckJ CUOTVCN4b9o/tLJ4CcVSzDqUOFMU2ky/IqfR4yUpLNlovhitSZMqG5yzlzX4eR0qfalO BsNrNER+QFexyobPQ4Ks0hFumZVCuGngkwM6kxFrRmHkk2pFgtOY8LAXrDYdIVdZVC7c kMHRhHkYpfT7Z1MAnUw+xG+F4mwXRMLldSrr3SbvsPVyFWrCWbBEmj38LSY48qilqhP5 DWXg== 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 a20-v6si17167148pgv.85.2018.09.03.10.16.57; Mon, 03 Sep 2018 10:17:12 -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 S1729530AbeICVg7 (ORCPT + 99 others); Mon, 3 Sep 2018 17:36:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42466 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727944AbeICVg6 (ORCPT ); Mon, 3 Sep 2018 17:36:58 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C96EBD06; Mon, 3 Sep 2018 17:15:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eyal Birger , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 002/165] vti6: fix PMTU caching and reporting on xmit Date: Mon, 3 Sep 2018 18:54:48 +0200 Message-Id: <20180903165655.128471631@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eyal Birger [ Upstream commit d6990976af7c5d8f55903bfb4289b6fb030bf754 ] When setting the skb->dst before doing the MTU check, the route PMTU caching and reporting is done on the new dst which is about to be released. Instead, PMTU handling should be done using the original dst. This is aligned with IPv4 VTI. Fixes: ccd740cbc6 ("vti6: Add pmtu handling to vti6_xmit.") Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_vti.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -480,10 +480,6 @@ vti6_xmit(struct sk_buff *skb, struct ne goto tx_err_dst_release; } - skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); - skb_dst_set(skb, dst); - skb->dev = skb_dst(skb)->dev; - mtu = dst_mtu(dst); if (!skb->ignore_df && skb->len > mtu) { skb_dst_update_pmtu(skb, mtu); @@ -498,9 +494,14 @@ vti6_xmit(struct sk_buff *skb, struct ne htonl(mtu)); } - return -EMSGSIZE; + err = -EMSGSIZE; + goto tx_err_dst_release; } + skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); + skb_dst_set(skb, dst); + skb->dev = skb_dst(skb)->dev; + err = dst_output(t->net, skb->sk, skb); if (net_xmit_eval(err) == 0) { struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);