Received: by 10.192.165.156 with SMTP id m28csp39053imm; Tue, 10 Apr 2018 15:57:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4892eTKtJGb+dVPyqfrQ6ra2zbisENJtjNOvRXtfa8uaFb2qee9tV4SUuJoTLyw+0Du260E X-Received: by 2002:a17:902:b90b:: with SMTP id bf11-v6mr2298326plb.399.1523401023632; Tue, 10 Apr 2018 15:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401023; cv=none; d=google.com; s=arc-20160816; b=ilhzEksa/RK0XwhLrVCc3xWEfYdus09P4tr8CzaMd7Gk14s81DCfRD4V/coNjfN1wE yMsg05A2mzJQRRcN6bJ6LgL5kvH0TK6lDqCzhzEGTSQMrYhhO39bXuiZ991ljeHfg2Hz RQP9uGThKEfKeOZ+ho4/BiUA4S9xFujS+J+0Q/WIY0Suu0m5/EtvjXZ/drSlFdKUCQuD KPJLlhp7n/1f9ltOT7vM9WNKY79TLye2yCFHEGeO2WKXBw+LV2o/FDp/iGAnbMZroqhf R9zHf8NH1yhS4VXifv+TlTNlBvmaaeWxVj0oCzIDN4YJZlGnEvjGsOIsQ7Spx9uzSekA dckw== 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=aI15aRaKVNlFEQxNrvI4f4DCc/CKcGmEUS5bbqdSViU=; b=0GQI320JSsGOfUOJ2oSlF2xQrS2Q8klg+6SUWEDe6VUWFXlFEgaBAhyOdzp307M5uN GncjoGlUcQdBvLfnDS3OepTKjN/7W+Dr698h/D4F6mXWarejtKcQcsEXCDdB91iT+5N5 5vRO2OgTNjDGLbV3X51ul4PmJCaF8fKHWmoZb8BKJSx1AkXmKrmAa4Ng/+JC46Y/05pD GoTDDC4uhaiZQ0dYOda44bB26UII1hs9R+ScsPJwNBUV7Zdgi8JYBEZnkUtgO51Ckg0d Ts+afd0jPpSosPWbb0zszYbI9Yk9ELXNoDTm4SD5oy2rgVUcqMTuX8C49L9vxE/jwQMX IY1Q== 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 o81si2894787pfa.64.2018.04.10.15.56.27; Tue, 10 Apr 2018 15:57:03 -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 S1755898AbeDJWiD (ORCPT + 99 others); Tue, 10 Apr 2018 18:38:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44122 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbeDJWiB (ORCPT ); Tue, 10 Apr 2018 18:38:01 -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 8185BCBC; Tue, 10 Apr 2018 22:38:00 +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.14 097/138] arp: fix arp_filter on l3slave devices Date: Wed, 11 Apr 2018 00:24:47 +0200 Message-Id: <20180410212913.454809972@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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: 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) {