Received: by 10.192.165.156 with SMTP id m28csp79909imm; Tue, 10 Apr 2018 16:52:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/gCWDLduhhpZydDTALxAPyyf/IofuDghgHT4lJ44Za9L/3FBINHf4PrsebWLDelENEYxFT X-Received: by 10.99.124.25 with SMTP id x25mr1768752pgc.46.1523404358615; Tue, 10 Apr 2018 16:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523404358; cv=none; d=google.com; s=arc-20160816; b=PAGAjp7evmH/SpyUpId1SoVwTXDzny6xL1/L/ttVIYm4IPEbuJiQb2vObSXcmVLdpZ LXX3VcyOoU7W1i0Zm0RBT5eBro39LOT6hN1gqslR/x8RI63ULev4CBMS9VLf2ul5tuKW txd0pJ3tf35ITgqbQTlbIgqbk/8gqd4mc3drXNIiYhqlB1uGWbq/o4bwIMfjBj7CrrHT bAfeGgPILzVAZvVntsVLaLybg346eD+oemsRy9ITLh+BwlpYV201J6GSGjm1ho6JM7ZF wHWBrb45d9XjMOAQ6B2XJRe9m9/u7uH+GYk3nuzsLBZ+hDKEhU38WT6B6UMN58oHBvIR K7iA== 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=sheMDRUd2M1jjG9jzerDVUMSlUNX+DXQTRlJ0BVzHks=; b=Iprka55Ay4JskroHNFv3b9OrJ5j/bhoSiAGRg/5xiSeP2Rxjv9sJPREhp2bL/HNnWt CQXyJ4QB4tp+rfaWlWEaKrcUpkmqUlzBS+lV/PPnF9UC277YsMZPqg7DgRaVOkDq8MyG FLFcImhTUd8dnKCPw8otbSJu5vHUL2Mnlw5pwXXozxkkGBzWmGhbApgF2L+9BH3vzX2z ULj7Q/OHCiNtm+XO5/oo/hNEZFI/B0zZB4PtJM3EWD1gRts+e3GBNWW5Ca9w9jm0TmCA eCa58xLQ+qpTBVeUQbU9CppwUEP8HHwfulubssi1NqngvldrrO8JEMG287+9to8xuNlM vnQA== 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 z11-v6si3511717plo.243.2018.04.10.16.52.02; Tue, 10 Apr 2018 16:52:38 -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 S1752200AbeDJWYN (ORCPT + 99 others); Tue, 10 Apr 2018 18:24:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36664 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeDJWYL (ORCPT ); Tue, 10 Apr 2018 18:24:11 -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 9DABBCF9; Tue, 10 Apr 2018 22:24:10 +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.16 02/18] arp: fix arp_filter on l3slave devices Date: Wed, 11 Apr 2018 00:23:37 +0200 Message-Id: <20180410212758.678446275@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212758.564682823@linuxfoundation.org> References: <20180410212758.564682823@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.16-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) {