linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Miguel Fadon Perlines <mfadon@teldat.com>,
	David Ahern <dsa@cumulusnetworks.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.16 02/18] arp: fix arp_filter on l3slave devices
Date: Wed, 11 Apr 2018 00:23:37 +0200	[thread overview]
Message-ID: <20180410212758.678446275@linuxfoundation.org> (raw)
In-Reply-To: <20180410212758.564682823@linuxfoundation.org>

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Miguel Fadon Perlines <mfadon@teldat.com>


[ 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 <mfadon@teldat.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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) {

  parent reply	other threads:[~2018-04-10 22:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 22:23 [PATCH 4.16 00/18] 4.16.2-stable review Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 01/18] sparc64: Oracle DAX driver depends on SPARC64 Greg Kroah-Hartman
2018-04-10 22:23 ` Greg Kroah-Hartman [this message]
2018-04-10 22:23 ` [PATCH 4.16 03/18] net: dsa: Discard frames from unused ports Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 04/18] net/ipv6: Increment OUTxxx counters after netfilter hook Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 05/18] net/sched: fix NULL dereference in the error path of tcf_bpf_init() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 06/18] pptp: remove a buggy dst release in pptp_connect() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 07/18] sctp: do not leak kernel memory to user space Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 08/18] sctp: sctp_sockaddr_af must check minimal addr length for AF_INET6 Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 09/18] sky2: Increase D3 delay to sky2 stops working after suspend Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 10/18] vlan: also check phy_driver ts_info for vlans real device Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 11/18] net: fool proof dev_valid_name() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 12/18] ip_tunnel: better validate user provided tunnel names Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 13/18] ipv6: sit: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 14/18] ip6_gre: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 15/18] ip6_tunnel: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 16/18] vti6: " Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 17/18] net_sched: fix a missing idr_remove() in u32_delete_key() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.16 18/18] nfp: use full 40 bits of the NSP buffer address Greg Kroah-Hartman
2018-04-11  6:02 ` [PATCH 4.16 00/18] 4.16.2-stable review kernelci.org bot
2018-04-11 17:15 ` Shuah Khan
2018-04-12 12:31   ` Greg Kroah-Hartman
2018-04-11 17:27 ` Guenter Roeck
2018-04-12 12:31   ` Greg Kroah-Hartman
2018-04-11 19:26 ` Dan Rue
2018-04-12 12:32   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180410212758.678446275@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfadon@teldat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).