Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1411547imm; Thu, 5 Jul 2018 22:53:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6h6tFxtYgOgZ0scOzE0atrMumXt2TutqKQuUK+bHpcV5iV4Z/yksSE9kwkjBFX3jubteD X-Received: by 2002:a62:3c4:: with SMTP id 187-v6mr9344991pfd.128.1530856408438; Thu, 05 Jul 2018 22:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856408; cv=none; d=google.com; s=arc-20160816; b=OhUfdIw4mEJSMUgmLk+mT8v5q3ncIt69DLQAtiXWmO51Sak46S4cRHXd5dI8LrgTdu aqW8HjY+6eo3O9bNmNGPUsCzKncihOX4ig+pFXIE9PNfKyuXz46WUobeZZZa9SIlKHr7 1IpvgHa9eL2m9Jd/7b214xq4MSpjdQCM3ZzWEJGsC//fCvPVsoq3Ogjst6W0AZF39CbE UqDPSUSynb1Iqp2U2fNDZHfN+C3Wcpl7NPlbvvK8ulfZWA9t1knSM5PRZXk963B7ZJQE vidJYAODD3eO4im/wDOrm4awc5+XKuTx15/+n88wM21oXAjLHA8+oE86QP4KGy2feR5k S6MA== 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=Xrx5XlbJPJpYCf7pTMndaxRoNRTRWTFtk95G0TZ7xLk=; b=PJxHaGRWyWfJJdft0qynZ8UzRuka2spbXjagAgPCNSdWwxxUG1elulKzz31Py2ntgU 2GxShpkAo32gzemen2Re9vfYipP63xav6TP1JGoGHA1VaWjrPWNr44WuSY1J0eIUc5ke Sy4+AX/8phrgisZfNJ2PxjI8VGEEjHHgfQNKDXOvmSP4NA/nAHhlXJ19jYe6PqnIsEps G42Y0G4dtN7XMYFYdbWsgs5TCayE25K0UaO5RgCIgiUPJg0Uv3bsNJSdU4fE2dodZx0W CmlcgyLymlZ4/TT9kLbgp8ncDUiSl2S4UBzsT7lZ3RaEQ1fP9MtBa+2huPJ0gAfyxD1b YUzA== 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 t22-v6si7344879plo.263.2018.07.05.22.53.14; Thu, 05 Jul 2018 22:53:28 -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 S934406AbeGFFvo (ORCPT + 99 others); Fri, 6 Jul 2018 01:51:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33444 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934326AbeGFFvk (ORCPT ); Fri, 6 Jul 2018 01:51:40 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5163B86A; Fri, 6 Jul 2018 05:51:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Bernat , Pablo Neira Ayuso Subject: [PATCH 4.14 41/61] netfilter: ip6t_rpfilter: provide input interface for route lookup Date: Fri, 6 Jul 2018 07:47:05 +0200 Message-Id: <20180706054713.908655929@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: Vincent Bernat commit cede24d1b21d68d84ac5a36c44f7d37daadcc258 upstream. In commit 47b7e7f82802, this bit was removed at the same time the RT6_LOOKUP_F_IFACE flag was removed. However, it is needed when link-local addresses are used, which is a very common case: when packets are routed, neighbor solicitations are done using link-local addresses. For example, the following neighbor solicitation is not matched by "-m rpfilter": IP6 fe80::5254:33ff:fe00:1 > ff02::1:ff00:3: ICMP6, neighbor solicitation, who has 2001:db8::5254:33ff:fe00:3, length 32 Commit 47b7e7f82802 doesn't quite explain why we shouldn't use RT6_LOOKUP_F_IFACE in the rpfilter case. I suppose the interface check later in the function would make it redundant. However, the remaining of the routing code is using RT6_LOOKUP_F_IFACE when there is no source address (which matches rpfilter's case with a non-unicast destination, like with neighbor solicitation). Signed-off-by: Vincent Bernat Fixes: 47b7e7f82802 ("netfilter: don't set F_IFACE on ipv6 fib lookups") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/ipv6/netfilter/ip6t_rpfilter.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv6/netfilter/ip6t_rpfilter.c +++ b/net/ipv6/netfilter/ip6t_rpfilter.c @@ -48,6 +48,8 @@ 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; rt = (void *) ip6_route_lookup(net, &fl6, lookup_flags); if (rt->dst.error)