Received: by 10.192.165.156 with SMTP id m28csp1098479imm; Wed, 11 Apr 2018 12:22:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JncQLISrSQNzKD3gWfoVJQhRxa2ziIfFvJPhhVDqgjoB5HvgV8AsrH7pzqrSkL6jGmknw X-Received: by 10.98.138.205 with SMTP id o74mr5143360pfk.114.1523474553762; Wed, 11 Apr 2018 12:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474553; cv=none; d=google.com; s=arc-20160816; b=Wwz14sv50LFcNNlIDunlqIDaFJ2g2I0tfqNRA4Tg6O/GYO9P4uo2FC5gYRDpK26Lpx k/MIKdKFCWRTw58kELhWUZQnUY/5wcvcLdYV0XBYcjUWZSF2ZxRA428qsamF4pflP38O ExACxa1QFgjTS9g1U+SYjDH/FxByZw4QXLO5YoeNJ9vkID/i2+iFAv0eh2EJLLwVZFzP W4bMJxxBAUA3cI1No+Q+mJDoLcSK6q4kG5rz885o9zV3pXekQPOKMgnocQ/RBYu4R/TS nWicSH7EQKwwcqzlDL/y40dHBKUk9vfrWFrkoi9qwedi94DXB0Wnz60ln3Tn6kmd8uCf ilww== 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=uBYldfdjNjfxP+wqgwGc5RkEmG6c5svM7vMPMTag/Lo=; b=Ms+K+maDOvIm4sEVE5m9xt9mX/IL2u7+K0fT3+PNDLYFWDAJoAP1OWtCgS+0p5YBWB p4ZBwrodulSHF+nPbIZNgFShwmxeoMPSHhyOno5cFc8FPNPBCjNWyWo3lhGpltb4jLdK trj7JeyKN/v8N0tYMHy12WODVZgOZI/I48iy1f+d9EGry3lr/TQuprcoqQGF+eNE5nsS W3e4hHlq4qGa0ZZjWT4SmXwhyh1WmaMzddmYMyMeHIhCIV8WiEpDPCxnyOvzVOHz+ePa HFwc03ZUPQ8tuXNxo94yeFe1Hgb2aVRtd01fl9SWQCIlyxX+hVJKZZvOIo1oOc5rs6eV cXdw== 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 h17si1338162pfj.178.2018.04.11.12.21.56; Wed, 11 Apr 2018 12:22:33 -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 S935016AbeDKTFU (ORCPT + 99 others); Wed, 11 Apr 2018 15:05:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40390 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934973AbeDKTFQ (ORCPT ); Wed, 11 Apr 2018 15:05:16 -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 910953EE; Wed, 11 Apr 2018 19:05:15 +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.9 276/310] arp: fix arp_filter on l3slave devices Date: Wed, 11 Apr 2018 20:36:55 +0200 Message-Id: <20180411183634.497130430@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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) {