lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Feb 2014 21:37:12 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Cong Wang <cwang@...pensource.com>
Cc:	Hannes Frederic Sowa <hannes@...essinduktion.org>,
	Cong Wang <xiyou.wangcong@...il.com>,
	netdev <netdev@...r.kernel.org>,
	Patrick McHardy <kaber@...sh.net>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [Patch net] macvlan: add NETIF_F_NETNS_LOCAL flag

On Mon, 2014-02-10 at 21:21 -0800, Eric Dumazet wrote:
> On Mon, 2014-02-10 at 20:41 -0800, Cong Wang wrote:
> 
> > Exactly broken by design.
> 
> Design of what ? Do you have a pointer to a document about this
> 'design' ?
> 
> > 
> > IFA_LINK is an ifindex, ifindex is per-netns. macvlan should not use IFA_LINK.
> 
> When this was 'designed', ifindex were not per netns.
> 
> Apparently nobody spotted this when ifindexes become per netns.
> 
> I am sure we can find a solution, keeping this very useful
> functionality.

Simple patch would be :

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 048dc8d183aa..31bbba34fd1e 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -963,6 +963,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
 	    nla_put_u32(skb, IFLA_NUM_RX_QUEUES, dev->num_rx_queues) ||
 #endif
 	    (dev->ifindex != dev->iflink &&
+	     __dev_get_by_index(dev_net(dev), dev->iflink) &&
 	     nla_put_u32(skb, IFLA_LINK, dev->iflink)) ||
 	    (upper_dev &&
 	     nla_put_u32(skb, IFLA_MASTER, upper_dev->ifindex)) ||


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ