Received: by 10.192.165.156 with SMTP id m28csp58783imm; Tue, 10 Apr 2018 16:21:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+k+6tcIUlCEjc9Cb0eTSSp9RVC31uZnuk5cjW6XSzD2AFHSdy7gORxUD0CnJl1tYs35Jk/ X-Received: by 10.99.147.82 with SMTP id w18mr1641393pgm.181.1523402472607; Tue, 10 Apr 2018 16:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402472; cv=none; d=google.com; s=arc-20160816; b=w5t+wp8JwDIRxg16GavyXuecWtsS31xvGTp1V0EJ1WhDO5VGHphp9ZV3TitF1q9gUe ZyRATooReeLDnA/SGxg8TnnrYO6doDSj8W5ktAURNALkNTr1fAKSksOAnWtqurGJQszf yBctV/UELPgdbcxli8m6MXzrllps4K1vW9u3TV1L4ck/cca1SEjh/W3S8ygHHyCYqgh1 ExG/V9Jd83q8RB6M4iiF5sQy/XQjsOi5Xk2avhOlH4l8Nwxyt+itstGwEp4jpWrYA4Ft 8xztAhER07XA5MdpjxF9/OnasUNViChQdnzEW61nU5i/rKz0VYGzsLa2o9kxmQzVR5Ce bFnA== 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=KhCvgzBvwswP0ub4eHfCb7cbkmt8CWKolP2CDmoTBek=; b=rh+omEkfqQyLr8NCc9wBW3P01GFcBWvME8I3scOaSn6rGGRJpDFX7D9ycTeS9lrlNi J3pk0K+V8NuxCQlE71ngL69+vz3loNDzopj3qNHGlrkfufsXUfQadJb9qlJAuQl+dL9o bVcIfoxU2EuDLHdD5Ub8a85pSLExta9kPjZbZAXhQjjM1jTxNTSvRJ1xdF8i5OAOPEcb ktlnJ1WMHTdtAqANgQZC+sMHPRKch299Hlfvk9H2VP6kPQPytQUCy+IgVlQPBQJf+ATx LrFLY407x6GLQeetAseVO90lMukClc4K+bE4oEFYS23gEvi8ZUPfKnloiQ1NzrGPsgbr cgEQ== 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 b31-v6si3703909pla.170.2018.04.10.16.20.35; Tue, 10 Apr 2018 16:21: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 S1756024AbeDJXPT (ORCPT + 99 others); Tue, 10 Apr 2018 19:15:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40802 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbeDJWcD (ORCPT ); Tue, 10 Apr 2018 18:32:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 28AD1A47; Tue, 10 Apr 2018 22:32:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miguel Fadon Perlines , David Ahern , "David S. Miller" Subject: [PATCH 4.15 121/168] arp: fix arp_filter on l3slave devices Date: Wed, 11 Apr 2018 00:24:23 +0200 Message-Id: <20180410212805.710092323@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miguel Fadon Perlines [ Upstream commit 58b35f27689b5eb514fc293c332966c226b1b6e4 ] arp_filter performs an ip_route_output search for arp source address and checks if output device is the same where the arp request was received, if it is not, the arp request is not answered. This route lookup is always done on main route table so l3slave devices never find the proper route and arp is not answered. Passing l3mdev_master_ifindex_rcu(dev) return value as oif fixes the lookup for l3slave devices while maintaining same behavior for non l3slave devices as this function returns 0 in that case. Fixes: 613d09b30f8b ("net: Use VRF device index for lookups on TX") Signed-off-by: Miguel Fadon Perlines Acked-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/arp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -437,7 +437,7 @@ static int arp_filter(__be32 sip, __be32 /*unsigned long now; */ struct net *net = dev_net(dev); - rt = ip_route_output(net, sip, tip, 0, 0); + rt = ip_route_output(net, sip, tip, 0, l3mdev_master_ifindex_rcu(dev)); if (IS_ERR(rt)) return 1; if (rt->dst.dev != dev) {