Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1415410imm; Thu, 5 Jul 2018 22:59:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf7B5/z1+jRAxtLkcibvNpGW6T0D6f6iik2rb2WKMD/8G/k0Lnw3WEI66YPukFLxHThwUHA X-Received: by 2002:a17:902:aa8f:: with SMTP id d15-v6mr8917476plr.262.1530856791201; Thu, 05 Jul 2018 22:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856791; cv=none; d=google.com; s=arc-20160816; b=Xzsdl4F4ABRMztlAiSWTvENjAScGB/zt8PrQCjAWfAp96tx9xkOthISb1DpoE0Tc37 ry+0JEjPuLV8s0sqF41n59tBaT8UvjSuOmn7T9fUnG0DI4ELo1gyqTwvMJKWPUzCrww/ Zv6eqig5f3eTe+ovXm1NCP74/vU9cSi7Hsv1SrYy8/6w8ANvqRgtkf6MgNeMZ+8zvBwu ZTTxIOg8ROKAQE4KA+EOpcIV+E8dZS8KoHHkR54VfoWfepnpXsJBnGS5HI7NoVzR3kb3 FPbCa0X23/epJENNGGu9U65BR4YEtpC6V/VsARd2+AQJcwRe7eFX/0KJv7W/r2PU2SG+ vPYg== 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=2h34q+djyEntEAmodZEHWkhGfk43BYBajrrik1N2KZo=; b=wXh4t8wHjsM+tQUt81KzdnAkPo64x9W2rgKaq9lMyY4E9pE1JArOIgOSvYFWbGERDw 8z+8dUcxd5hpmrXv5U8i8LI8W95AJrl9XRocibQFed5tcfNySJjy1MSCwbrxv9RcY4fZ 7Qw5S0TUURYgoQaa7gMEI7UYCgAV+aZ9wAPBARBYKZgEsexNwzG779dlRhMDSfl+dcUr I/yDK4gSfN2+KNxpqYwtJqD1qxReVeVFfYIxfyv/lByhNvVMQ0dmqpt03aBygmEOB7MB LbPyTfAq3p4jTdiz0Jf5BcThbi7WyjBcK1UPdO1hSXrGKRGSIsk8fFLD1rHNGSlsXvky H0zg== 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 h2-v6si7526742plh.339.2018.07.05.22.59.37; Thu, 05 Jul 2018 22:59:51 -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 S934587AbeGFF5W (ORCPT + 99 others); Fri, 6 Jul 2018 01:57:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33418 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934372AbeGFFvh (ORCPT ); Fri, 6 Jul 2018 01:51:37 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4234686A; Fri, 6 Jul 2018 05:51:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.14 40/61] netfilter: dont set F_IFACE on ipv6 fib lookups Date: Fri, 6 Jul 2018 07:47:04 +0200 Message-Id: <20180706054713.871605357@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054712.332416244@linuxfoundation.org> References: <20180706054712.332416244@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: Florian Westphal commit 47b7e7f82802dced3ac73658bf4b77584a63063f upstream. "fib" starts to behave strangely when an ipv6 default route is added - the FIB lookup returns a route using 'oif' in this case. This behaviour was inherited from ip6tables rpfilter so change this as well. Bugzilla: https://bugzilla.netfilter.org/show_bug.cgi?id=1221 Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/ipv6/netfilter/ip6t_rpfilter.c | 4 ---- net/ipv6/netfilter/nft_fib_ipv6.c | 12 ++---------- 2 files changed, 2 insertions(+), 14 deletions(-) --- a/net/ipv6/netfilter/ip6t_rpfilter.c +++ b/net/ipv6/netfilter/ip6t_rpfilter.c @@ -48,10 +48,6 @@ static bool rpfilter_lookup_reverse6(str } fl6.flowi6_mark = flags & XT_RPFILTER_VALID_MARK ? skb->mark : 0; - if ((flags & XT_RPFILTER_LOOSE) == 0) { - fl6.flowi6_oif = dev->ifindex; - lookup_flags |= RT6_LOOKUP_F_IFACE; - } rt = (void *) ip6_route_lookup(net, &fl6, lookup_flags); if (rt->dst.error) --- a/net/ipv6/netfilter/nft_fib_ipv6.c +++ b/net/ipv6/netfilter/nft_fib_ipv6.c @@ -182,7 +182,6 @@ void nft_fib6_eval(const struct nft_expr } *dest = 0; - again: rt = (void *)ip6_route_lookup(nft_net(pkt), &fl6, lookup_flags); if (rt->dst.error) goto put_rt_err; @@ -191,15 +190,8 @@ void nft_fib6_eval(const struct nft_expr if (rt->rt6i_flags & (RTF_REJECT | RTF_ANYCAST | RTF_LOCAL)) goto put_rt_err; - if (oif && oif != rt->rt6i_idev->dev) { - /* multipath route? Try again with F_IFACE */ - if ((lookup_flags & RT6_LOOKUP_F_IFACE) == 0) { - lookup_flags |= RT6_LOOKUP_F_IFACE; - fl6.flowi6_oif = oif->ifindex; - ip6_rt_put(rt); - goto again; - } - } + if (oif && oif != rt->rt6i_idev->dev) + goto put_rt_err; switch (priv->result) { case NFT_FIB_RESULT_OIF: