<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/net/core/rtnetlink.c, branch v3.14.5</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.14.5</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.14.5'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2014-05-31T20:20:38+00:00</updated>
<entry>
<title>rtnetlink: wait for unregistering devices in rtnl_link_unregister()</title>
<updated>2014-05-31T20:20:38+00:00</updated>
<author>
<name>Cong Wang</name>
<email>cwang@twopensource.com</email>
</author>
<published>2014-05-12T22:11:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=af8c0e0612f5288b895d427f275d8ca436efab24'/>
<id>urn:sha1:af8c0e0612f5288b895d427f275d8ca436efab24</id>
<content type='text'>
[ Upstream commit 200b916f3575bdf11609cb447661b8d5957b0bbf ]

From: Cong Wang &lt;cwang@twopensource.com&gt;

commit 50624c934db18ab90 (net: Delay default_device_exit_batch until no
devices are unregistering) introduced rtnl_lock_unregistering() for
default_device_exit_batch(). Same race could happen we when rmmod a driver
which calls rtnl_link_unregister() as we call dev-&gt;destructor without rtnl
lock.

For long term, I think we should clean up the mess of netdev_run_todo()
and net namespce exit code.

Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Cong Wang &lt;cwang@twopensource.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtnetlink: Only supply IFLA_VF_PORTS information when RTEXT_FILTER_VF is set</title>
<updated>2014-05-31T20:20:35+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2014-04-24T00:22:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=657cad06d60c2c7f032257125683627fb5480d21'/>
<id>urn:sha1:657cad06d60c2c7f032257125683627fb5480d21</id>
<content type='text'>
[ Upstream commit c53864fd60227de025cb79e05493b13f69843971 ]

Since 115c9b81928360d769a76c632bae62d15206a94a (rtnetlink: Fix problem with
buffer allocation), RTM_NEWLINK messages only contain the IFLA_VFINFO_LIST
attribute if they were solicited by a GETLINK message containing an
IFLA_EXT_MASK attribute with the RTEXT_FILTER_VF flag.

That was done because some user programs broke when they received more data
than expected - because IFLA_VFINFO_LIST contains information for each VF
it can become large if there are many VFs.

However, the IFLA_VF_PORTS attribute, supplied for devices which implement
ndo_get_vf_port (currently the 'enic' driver only), has the same problem.
It supplies per-VF information and can therefore become large, but it is
not currently conditional on the IFLA_EXT_MASK value.

Worse, it interacts badly with the existing EXT_MASK handling.  When
IFLA_EXT_MASK is not supplied, the buffer for netlink replies is fixed at
NLMSG_GOODSIZE.  If the information for IFLA_VF_PORTS exceeds this, then
rtnl_fill_ifinfo() returns -EMSGSIZE on the first message in a packet.
netlink_dump() will misinterpret this as having finished the listing and
omit data for this interface and all subsequent ones.  That can cause
getifaddrs(3) to enter an infinite loop.

This patch addresses the problem by only supplying IFLA_VF_PORTS when
IFLA_EXT_MASK is supplied with the RTEXT_FILTER_VF flag set.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtnetlink: Warn when interface's information won't fit in our packet</title>
<updated>2014-05-31T20:20:34+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2014-04-24T00:22:35+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=22d964f55e6d59186415fc017b8095992805c916'/>
<id>urn:sha1:22d964f55e6d59186415fc017b8095992805c916</id>
<content type='text'>
[ Upstream commit 973462bbde79bb827824c73b59027a0aed5c9ca6 ]

Without IFLA_EXT_MASK specified, the information reported for a single
interface in response to RTM_GETLINK is expected to fit within a netlink
packet of NLMSG_GOODSIZE.

If it doesn't, however, things will go badly wrong,  When listing all
interfaces, netlink_dump() will incorrectly treat -EMSGSIZE on the first
message in a packet as the end of the listing and omit information for
that interface and all subsequent ones.  This can cause getifaddrs(3) to
enter an infinite loop.

This patch won't fix the problem, but it will WARN_ON() making it easier to
track down what's going wrong.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Jiri Pirko &lt;jpirko@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtnetlink: fix fdb notification flags</title>
<updated>2014-03-20T20:24:28+00:00</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2014-03-19T16:47:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1c104a6bebf3c16b6248408b84f91d09ac8a26b6'/>
<id>urn:sha1:1c104a6bebf3c16b6248408b84f91d09ac8a26b6</id>
<content type='text'>
Commit 3ff661c38c84 ("net: rtnetlink notify events for FDB NTF_SELF adds and
deletes") reuses the function nlmsg_populate_fdb_fill() to notify fdb events.
But this function was used only for dump and thus was always setting the
flag NLM_F_MULTI, which is wrong in case of a single notification.

Libraries like libnl will wait forever for NLMSG_DONE.

CC: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: correct error path in rtnl_newlink()</title>
<updated>2014-02-13T22:08:29+00:00</updated>
<author>
<name>Cong Wang</name>
<email>cwang@twopensource.com</email>
</author>
<published>2014-02-11T23:51:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0e0eee2465df77bcec2e8ff75432b8e57897b143'/>
<id>urn:sha1:0e0eee2465df77bcec2e8ff75432b8e57897b143</id>
<content type='text'>
I saw the following BUG when -&gt;newlink() fails in rtnl_newlink():

[   40.240058] kernel BUG at net/core/dev.c:6438!

this is due to free_netdev() is not supposed to be called before
netdev is completely unregistered, therefore it is not correct
to call free_netdev() here, at least for ops-&gt;newlink!=NULL case,
many drivers call it in -&gt;destructor so that rtnl_unlock() will
take care of it, we probably don't need to do anything here.

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Cong Wang &lt;cwang@twopensource.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: fix oops in rtnl_link_get_slave_info_data_size</title>
<updated>2014-02-05T04:28:51+00:00</updated>
<author>
<name>Fernando Luis Vazquez Cao</name>
<email>fernando_b1@lab.ntt.co.jp</email>
</author>
<published>2014-02-04T10:35:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6049f2530cf2cb48a6fe8735309cc0b97aa7f700'/>
<id>urn:sha1:6049f2530cf2cb48a6fe8735309cc0b97aa7f700</id>
<content type='text'>
We should check whether rtnetlink link operations
are defined before calling get_slave_size().

Without this, the following oops can occur when
adding a tap device to OVS.

[   87.839553] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
[   87.839595] IP: [&lt;ffffffff813d47c0&gt;] if_nlmsg_size+0xf0/0x220
[...]
[   87.840651] Call Trace:
[   87.840664]  [&lt;ffffffff813d694b&gt;] ? rtmsg_ifinfo+0x2b/0x100
[   87.840688]  [&lt;ffffffff813c8340&gt;] ? __netdev_adjacent_dev_insert+0x150/0x1a0
[   87.840718]  [&lt;ffffffff813d6a50&gt;] ? rtnetlink_event+0x30/0x40
[   87.840742]  [&lt;ffffffff814b4144&gt;] ? notifier_call_chain+0x44/0x70
[   87.840768]  [&lt;ffffffff813c8946&gt;] ? __netdev_upper_dev_link+0x3c6/0x3f0
[   87.840798]  [&lt;ffffffffa0678d6c&gt;] ? netdev_create+0xcc/0x160 [openvswitch]
[   87.840828]  [&lt;ffffffffa06781ea&gt;] ? ovs_vport_add+0x4a/0xd0 [openvswitch]
[   87.840857]  [&lt;ffffffffa0670139&gt;] ? new_vport+0x9/0x50 [openvswitch]
[   87.840884]  [&lt;ffffffffa067279e&gt;] ? ovs_vport_cmd_new+0x11e/0x210 [openvswitch]
[   87.840915]  [&lt;ffffffff813f3efa&gt;] ? genl_family_rcv_msg+0x19a/0x360
[   87.840941]  [&lt;ffffffff813f40c0&gt;] ? genl_family_rcv_msg+0x360/0x360
[   87.840967]  [&lt;ffffffff813f4139&gt;] ? genl_rcv_msg+0x79/0xc0
[   87.840991]  [&lt;ffffffff813b6cf9&gt;] ? __kmalloc_reserve.isra.25+0x29/0x80
[   87.841018]  [&lt;ffffffff813f2389&gt;] ? netlink_rcv_skb+0xa9/0xc0
[   87.841042]  [&lt;ffffffff813f27cf&gt;] ? genl_rcv+0x1f/0x30
[   87.841064]  [&lt;ffffffff813f1988&gt;] ? netlink_unicast+0xe8/0x1e0
[   87.841088]  [&lt;ffffffff813f1d9a&gt;] ? netlink_sendmsg+0x31a/0x750
[   87.841113]  [&lt;ffffffff813aee96&gt;] ? sock_sendmsg+0x86/0xc0
[   87.841136]  [&lt;ffffffff813c960d&gt;] ? __netdev_update_features+0x4d/0x200
[   87.841163]  [&lt;ffffffff813ca94e&gt;] ? ethtool_get_value+0x2e/0x50
[   87.841188]  [&lt;ffffffff813af269&gt;] ? ___sys_sendmsg+0x359/0x370
[   87.841212]  [&lt;ffffffff813da686&gt;] ? dev_ioctl+0x1a6/0x5c0
[   87.841236]  [&lt;ffffffff8109c210&gt;] ? autoremove_wake_function+0x30/0x30
[   87.841264]  [&lt;ffffffff813ac59d&gt;] ? sock_do_ioctl+0x3d/0x50
[   87.841288]  [&lt;ffffffff813aca68&gt;] ? sock_ioctl+0x1e8/0x2c0
[   87.841312]  [&lt;ffffffff811934bf&gt;] ? do_vfs_ioctl+0x2cf/0x4b0
[   87.841335]  [&lt;ffffffff813afeb9&gt;] ? __sys_sendmsg+0x39/0x70
[   87.841362]  [&lt;ffffffff814b86f9&gt;] ? system_call_fastpath+0x16/0x1b
[   87.841386] Code: c0 74 10 48 89 ef ff d0 83 c0 07 83 e0 fc 48 98 49 01 c7 48 89 ef e8 d0 d6 fe ff 48 85 c0 0f 84 df 00 00 00 48 8b 90 08 07 00 00 &lt;48&gt; 8b 8a a8 00 00 00 31 d2 48 85 c9 74 0c 48 89 ee 48 89 c7 ff
[   87.841529] RIP  [&lt;ffffffff813d47c0&gt;] if_nlmsg_size+0xf0/0x220
[   87.841555]  RSP &lt;ffff880221aa5950&gt;
[   87.841569] CR2: 00000000000000a8
[   87.851442] ---[ end trace e42ab217691b4fc2 ]---

Signed-off-by: Fernando Luis Vazquez Cao &lt;fernando@oss.ntt.co.jp&gt;
Acked-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: remove check for fill_slave_info in rtnl_have_link_slave_info</title>
<updated>2014-01-24T00:21:48+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-01-23T18:19:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=813f020c5d16878486b9a103bd59831846652247'/>
<id>urn:sha1:813f020c5d16878486b9a103bd59831846652247</id>
<content type='text'>
This check is not needed because the same check is done before
fill_slave_info is used in rtnl_link_slave_info_fill.
Also, by removing this check, kernel will fillup IFLA_INFO_SLAVE_KIND
even for slaves of masters which does not implement fill_slave_info.

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: convert netlink to use slave data info api</title>
<updated>2014-01-23T05:57:17+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-01-22T08:05:56+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3bad540ed8285fb53f6365420bba0320d8cd2066'/>
<id>urn:sha1:3bad540ed8285fb53f6365420bba0320d8cd2066</id>
<content type='text'>
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: provide api for getting and setting slave info</title>
<updated>2014-01-23T05:57:05+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-01-22T08:05:55+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ba7d49b1f0f8e5f24294a880ed576964059af5ef'/>
<id>urn:sha1:ba7d49b1f0f8e5f24294a880ed576964059af5ef</id>
<content type='text'>
Recent patch
bonding: add netlink attributes to slave link dev (1d3ee88ae0d6)

Introduced yet another device specific way to access slave information
over rtnetlink. There is one already there for bridge.

This patch introduces generic way to do this, for getting and setting
info as well by extending link_ops. Later on, this new interface will
be used for bridge ports as well.

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: put "BOND" into nl attribute names which are related to bonding</title>
<updated>2014-01-23T05:57:05+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-01-22T08:05:54+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=df7dbcbbafc0b8f3fb31a40c6f3c4a7e15cb0b40'/>
<id>urn:sha1:df7dbcbbafc0b8f3fb31a40c6f3c4a7e15cb0b40</id>
<content type='text'>
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
