Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2016070imu; Fri, 14 Dec 2018 04:33:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/U7YpbTnwHOCJYArrtx2fBpeb5HLFSpKqcyytJ6tfjses4QczwDydnZStq91UKou0T7Khm6 X-Received: by 2002:a63:fd53:: with SMTP id m19mr2608299pgj.340.1544790793015; Fri, 14 Dec 2018 04:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544790792; cv=none; d=google.com; s=arc-20160816; b=jXWqdDbBDoUFTMIi484fP1JD3y6H0ajVHJqAhn5+xDmsflMzNlvs/00KtmYqKuH7N1 7jsAq51HCBObmLCSLURre+pq6YOr/yy7PyNG1rHGkwkhDUsWhtJ6awUB4hyJZkEYQ0jx W9k3S0D1OK4i1eDY7kkLscERoayjGbToqYcllEAHMH1rOa9i6Oy5GXYuRHHd/ipRsPS1 gRKvVsJgo0SsB3VhbjHKKPadxIpKEf0JW+dDmSIA9JZuTlUBiYEcMoVtespFqXcNh2s7 IHq7xi2ernTrtsWN0a3IL/Up1tA/YsxvFGn5lqoPpJkqkGAOosLMaYH38bY8fIK0c4ph O4dQ== 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:dkim-signature; bh=XQ5fiAmFvhwDT+OmcSzE1lwEJZj2CE0muVrvxOH9/1c=; b=sxQPXUmJpRMzLIkDHjegT/uv0WlW4q+3Yo7zKpeH9TU0axyXiw/9rAdQkqxTElBMCd mtHpv97oOzKQqDuW9TLGS4Du2Rpo1JwZKYXS4XPv2FPCMO4cUDPBQYzZMsei6/gCT/HM he7IuTjISSN6/V0SSgP7JtdS6SEwfwsr46B3zlhGsUn+/rAZzBUwmvhNTTSoBd4N1VlU axu/A+LtGQsutUmFxZL/j3ZGQq9GRgwJV5a7DNYgCJ3KFUlTrKz0EyajuPA6MgH/ZPuZ sBk4joEVgL+DOOZ4N0Ml4Zn2sZS287v95aqzKNBaKbjYbbbuEzFhrJcZR9w8rRDyOpA+ U5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GZ2MZHVT; 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 g15si4046313pgl.141.2018.12.14.04.32.51; Fri, 14 Dec 2018 04:33:12 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=GZ2MZHVT; 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 S1731645AbeLNMb6 (ORCPT + 99 others); Fri, 14 Dec 2018 07:31:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:55072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730693AbeLNMJW (ORCPT ); Fri, 14 Dec 2018 07:09:22 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 659B9214AE; Fri, 14 Dec 2018 12:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789361; bh=UQUkZN3dsVq4Yqnb+WSLIuljxkyTSVal89fob/0QlnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GZ2MZHVTRUu6651yG+5GuhQn4OYKlYnC0MHnydvy9+0OWwu3Oprhvce7hxdcNXEeL /ERKDl4SC00UFh6ihbn1+XhsEkzRcT1v91GwKZdOHt/vwumpvwBnK9SSJ9ZcS0e0EZ Ejldj3BnBUrIq6zoHlg9wV56sChVpCGk/bhOdPSc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alin Nastac , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.14 53/89] netfilter: ipv6: Preserve link scope traffic original oif Date: Fri, 14 Dec 2018 13:00:06 +0100 Message-Id: <20181214115732.294320091@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115729.658859279@linuxfoundation.org> References: <20181214115729.658859279@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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. ------------------ [ Upstream commit 508b09046c0f21678652fb66fd1e9959d55591d2 ] When ip6_route_me_harder is invoked, it resets outgoing interface of: - link-local scoped packets sent by neighbor discovery - multicast packets sent by MLD host - multicast packets send by MLD proxy daemon that sets outgoing interface through IPV6_PKTINFO ipi6_ifindex Link-local and multicast packets must keep their original oif after ip6_route_me_harder is called. Signed-off-by: Alin Nastac Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/ipv6/netfilter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 9bf260459f83..1f8b1a433b5d 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c @@ -25,7 +25,8 @@ int ip6_route_me_harder(struct net *net, struct sk_buff *skb) unsigned int hh_len; struct dst_entry *dst; struct flowi6 fl6 = { - .flowi6_oif = sk ? sk->sk_bound_dev_if : 0, + .flowi6_oif = sk && sk->sk_bound_dev_if ? sk->sk_bound_dev_if : + rt6_need_strict(&iph->daddr) ? skb_dst(skb)->dev->ifindex : 0, .flowi6_mark = skb->mark, .flowi6_uid = sock_net_uid(net, sk), .daddr = iph->daddr, -- 2.19.1