<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/rtnetlink.c, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-24T17:02:32Z</updated>
<entry>
<title>net: use for_each_netdev_safe() in rtnl_group_changelink()</title>
<updated>2015-03-24T17:02:32Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-03-23T23:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d079535d5e1bf5e2e7c856bae2483414ea21e137'/>
<id>urn:sha1:d079535d5e1bf5e2e7c856bae2483414ea21e137</id>
<content type='text'>
In case we move the whole dev group to another netns,
we should call for_each_netdev_safe(), otherwise we get
a soft lockup:

 NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [ip:798]
 irq event stamp: 255424
 hardirqs last  enabled at (255423): [&lt;ffffffff81a2aa95&gt;] restore_args+0x0/0x30
 hardirqs last disabled at (255424): [&lt;ffffffff81a2ad5a&gt;] apic_timer_interrupt+0x6a/0x80
 softirqs last  enabled at (255422): [&lt;ffffffff81079ebc&gt;] __do_softirq+0x2c1/0x3a9
 softirqs last disabled at (255417): [&lt;ffffffff8107a190&gt;] irq_exit+0x41/0x95
 CPU: 0 PID: 798 Comm: ip Not tainted 4.0.0-rc4+ #881
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 task: ffff8800d1b88000 ti: ffff880119530000 task.ti: ffff880119530000
 RIP: 0010:[&lt;ffffffff810cad11&gt;]  [&lt;ffffffff810cad11&gt;] debug_lockdep_rcu_enabled+0x28/0x30
 RSP: 0018:ffff880119533778  EFLAGS: 00000246
 RAX: ffff8800d1b88000 RBX: 0000000000000002 RCX: 0000000000000038
 RDX: 0000000000000000 RSI: ffff8800d1b888c8 RDI: ffff8800d1b888c8
 RBP: ffff880119533778 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000000 R11: 000000000000b5c2 R12: 0000000000000246
 R13: ffff880119533708 R14: 00000000001d5a40 R15: ffff88011a7d5a40
 FS:  00007fc01315f740(0000) GS:ffff88011a600000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 00007f367a120988 CR3: 000000011849c000 CR4: 00000000000007f0
 Stack:
  ffff880119533798 ffffffff811ac868 ffffffff811ac831 ffffffff811ac828
  ffff8801195337c8 ffffffff811ac8c9 ffff8801195339b0 ffff8801197633e0
  0000000000000000 ffff8801195339b0 ffff8801195337d8 ffffffff811ad2d7
 Call Trace:
  [&lt;ffffffff811ac868&gt;] rcu_read_lock+0x37/0x6e
  [&lt;ffffffff811ac831&gt;] ? rcu_read_unlock+0x5f/0x5f
  [&lt;ffffffff811ac828&gt;] ? rcu_read_unlock+0x56/0x5f
  [&lt;ffffffff811ac8c9&gt;] __fget+0x2a/0x7a
  [&lt;ffffffff811ad2d7&gt;] fget+0x13/0x15
  [&lt;ffffffff811be732&gt;] proc_ns_fget+0xe/0x38
  [&lt;ffffffff817c7714&gt;] get_net_ns_by_fd+0x11/0x59
  [&lt;ffffffff817df359&gt;] rtnl_link_get_net+0x33/0x3e
  [&lt;ffffffff817df3d7&gt;] do_setlink+0x73/0x87b
  [&lt;ffffffff810b28ce&gt;] ? trace_hardirqs_off+0xd/0xf
  [&lt;ffffffff81a2aa95&gt;] ? retint_restore_args+0xe/0xe
  [&lt;ffffffff817e0301&gt;] rtnl_newlink+0x40c/0x699
  [&lt;ffffffff817dffe0&gt;] ? rtnl_newlink+0xeb/0x699
  [&lt;ffffffff81a29246&gt;] ? _raw_spin_unlock+0x28/0x33
  [&lt;ffffffff8143ed1e&gt;] ? security_capable+0x18/0x1a
  [&lt;ffffffff8107da51&gt;] ? ns_capable+0x4d/0x65
  [&lt;ffffffff817de5ce&gt;] rtnetlink_rcv_msg+0x181/0x194
  [&lt;ffffffff817de407&gt;] ? rtnl_lock+0x17/0x19
  [&lt;ffffffff817de407&gt;] ? rtnl_lock+0x17/0x19
  [&lt;ffffffff817de44d&gt;] ? __rtnl_unlock+0x17/0x17
  [&lt;ffffffff818327c6&gt;] netlink_rcv_skb+0x4d/0x93
  [&lt;ffffffff817de42f&gt;] rtnetlink_rcv+0x26/0x2d
  [&lt;ffffffff81830f18&gt;] netlink_unicast+0xcb/0x150
  [&lt;ffffffff8183198e&gt;] netlink_sendmsg+0x501/0x523
  [&lt;ffffffff8115cba9&gt;] ? might_fault+0x59/0xa9
  [&lt;ffffffff817b5398&gt;] ? copy_from_user+0x2a/0x2c
  [&lt;ffffffff817b7b74&gt;] sock_sendmsg+0x34/0x3c
  [&lt;ffffffff817b7f6d&gt;] ___sys_sendmsg+0x1b8/0x255
  [&lt;ffffffff8115c5eb&gt;] ? handle_pte_fault+0xbd5/0xd4a
  [&lt;ffffffff8100a2b0&gt;] ? native_sched_clock+0x35/0x37
  [&lt;ffffffff8109e94b&gt;] ? sched_clock_local+0x12/0x72
  [&lt;ffffffff8109eb9c&gt;] ? sched_clock_cpu+0x9e/0xb7
  [&lt;ffffffff810cadbf&gt;] ? rcu_read_lock_held+0x3b/0x3d
  [&lt;ffffffff811ac1d8&gt;] ? __fcheck_files+0x4c/0x58
  [&lt;ffffffff811ac946&gt;] ? __fget_light+0x2d/0x52
  [&lt;ffffffff817b8adc&gt;] __sys_sendmsg+0x42/0x60
  [&lt;ffffffff817b8b0c&gt;] SyS_sendmsg+0x12/0x1c
  [&lt;ffffffff81a29e32&gt;] system_call_fastpath+0x12/0x17

Fixes: e7ed828f10bd8 ("netlink: support setting devgroup parameters")
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Handle unregister properly when netdev namespace change fails.</title>
<updated>2015-03-11T01:59:46Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-03-11T01:58:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4363890079674db7b00cf1bb0e6fa430e846e86b'/>
<id>urn:sha1:4363890079674db7b00cf1bb0e6fa430e846e86b</id>
<content type='text'>
If rtnl_newlink() fails on it's call to dev_change_net_namespace(), we
have to make use of the -&gt;dellink() method, if present, just like we
do when rtnl_configure_link() fails.

Fixes: 317f4810e45e ("rtnl: allow to create device with IFLA_LINK_NETNSID set")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: do not use rcu in rtnl_dump_ifinfo()</title>
<updated>2015-03-01T05:07:00Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-02-27T17:42:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cac5e65e8a7ea074f2626d2eaa53aa308452dec4'/>
<id>urn:sha1:cac5e65e8a7ea074f2626d2eaa53aa308452dec4</id>
<content type='text'>
We did a failed attempt in the past to only use rcu in rtnl dump
operations (commit e67f88dd12f6 "net: dont hold rtnl mutex during
netlink dump callbacks")

Now that dumps are holding RTNL anyway, there is no need to also
use rcu locking, as it forbids any scheduling ability, like
GFP_KERNEL allocations that controlling path should use instead
of GFP_ATOMIC whenever possible.

This should fix following splat Cong Wang reported :

 [ INFO: suspicious RCU usage. ]
 3.19.0+ #805 Tainted: G        W

 include/linux/rcupdate.h:538 Illegal context switch in RCU read-side critical section!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 2 locks held by ip/771:
  #0:  (rtnl_mutex){+.+.+.}, at: [&lt;ffffffff8182b8f4&gt;] netlink_dump+0x21/0x26c
  #1:  (rcu_read_lock){......}, at: [&lt;ffffffff817d785b&gt;] rcu_read_lock+0x0/0x6e

 stack backtrace:
 CPU: 3 PID: 771 Comm: ip Tainted: G        W       3.19.0+ #805
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000001 ffff8800d51e7718 ffffffff81a27457 0000000029e729e6
  ffff8800d6108000 ffff8800d51e7748 ffffffff810b539b ffffffff820013dd
  00000000000001c8 0000000000000000 ffff8800d7448088 ffff8800d51e7758
 Call Trace:
  [&lt;ffffffff81a27457&gt;] dump_stack+0x4c/0x65
  [&lt;ffffffff810b539b&gt;] lockdep_rcu_suspicious+0x107/0x110
  [&lt;ffffffff8109796f&gt;] rcu_preempt_sleep_check+0x45/0x47
  [&lt;ffffffff8109e457&gt;] ___might_sleep+0x1d/0x1cb
  [&lt;ffffffff8109e67d&gt;] __might_sleep+0x78/0x80
  [&lt;ffffffff814b9b1f&gt;] idr_alloc+0x45/0xd1
  [&lt;ffffffff810cb7ab&gt;] ? rcu_read_lock_held+0x3b/0x3d
  [&lt;ffffffff814b9f9d&gt;] ? idr_for_each+0x53/0x101
  [&lt;ffffffff817c1383&gt;] alloc_netid+0x61/0x69
  [&lt;ffffffff817c14c3&gt;] __peernet2id+0x79/0x8d
  [&lt;ffffffff817c1ab7&gt;] peernet2id+0x13/0x1f
  [&lt;ffffffff817d8673&gt;] rtnl_fill_ifinfo+0xa8d/0xc20
  [&lt;ffffffff810b17d9&gt;] ? __lock_is_held+0x39/0x52
  [&lt;ffffffff817d894f&gt;] rtnl_dump_ifinfo+0x149/0x213
  [&lt;ffffffff8182b9c2&gt;] netlink_dump+0xef/0x26c
  [&lt;ffffffff8182bcba&gt;] netlink_recvmsg+0x17b/0x2c5
  [&lt;ffffffff817b0adc&gt;] __sock_recvmsg+0x4e/0x59
  [&lt;ffffffff817b1b40&gt;] sock_recvmsg+0x3f/0x51
  [&lt;ffffffff817b1f9a&gt;] ___sys_recvmsg+0xf6/0x1d9
  [&lt;ffffffff8115dc67&gt;] ? handle_pte_fault+0x6e1/0xd3d
  [&lt;ffffffff8100a3a0&gt;] ? native_sched_clock+0x35/0x37
  [&lt;ffffffff8109f45b&gt;] ? sched_clock_local+0x12/0x72
  [&lt;ffffffff8109f6ac&gt;] ? sched_clock_cpu+0x9e/0xb7
  [&lt;ffffffff810cb7ab&gt;] ? rcu_read_lock_held+0x3b/0x3d
  [&lt;ffffffff811abde8&gt;] ? __fcheck_files+0x4c/0x58
  [&lt;ffffffff811ac556&gt;] ? __fget_light+0x2d/0x52
  [&lt;ffffffff817b376f&gt;] __sys_recvmsg+0x42/0x60
  [&lt;ffffffff817b379f&gt;] SyS_recvmsg+0x12/0x1c

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Fixes: 0c7aecd4bde4b7302 ("netns: add rtnl cmd to add and get peer netns ids")
Cc: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Reported-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Verify permission to link_net in newlink</title>
<updated>2015-02-28T20:14:44Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-02-26T22:20:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06615bed60c1fb7c37adddb75bdc80da873b5edb'/>
<id>urn:sha1:06615bed60c1fb7c37adddb75bdc80da873b5edb</id>
<content type='text'>
When applicable verify that the caller has permisson to the underlying
network namespace for a newly created network device.

Similary checks exist for the network namespace a network device will
be created in.

Fixes: 317f4810e45e ("rtnl: allow to create device with IFLA_LINK_NETNSID set")
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Verify permission to dest_net in newlink</title>
<updated>2015-02-28T20:14:44Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-02-26T22:19:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=505ce4154ac86c250aa4a84a536dd9fc56479bb5'/>
<id>urn:sha1:505ce4154ac86c250aa4a84a536dd9fc56479bb5</id>
<content type='text'>
When applicable verify that the caller has permision to create a
network device in another network namespace.  This check is already
present when moving a network device between network namespaces in
setlink so all that is needed is to duplicate that check in newlink.

This change almost backports cleanly, but there are context conflicts
as the code that follows was added in v4.0-rc1

Fixes: b51642f6d77b net: Enable a userns root rtnl calls that are safe for unprivilged users
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: avoid 0 sized arrays</title>
<updated>2015-02-24T20:39:09Z</updated>
<author>
<name>Sasha Levin</name>
<email>sasha.levin@oracle.com</email>
</author>
<published>2015-02-24T19:14:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e10fd5b4a7f4100007147558c304da3e73b25cf'/>
<id>urn:sha1:4e10fd5b4a7f4100007147558c304da3e73b25cf</id>
<content type='text'>
Arrays (when not in a struct) "shall have a value greater than zero".

GCC complains when it's not the case here.

Fixes: ba7d49b1f0 ("rtnetlink: provide api for getting and setting slave info")
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: call -&gt;dellink on failure when -&gt;newlink exists</title>
<updated>2015-02-15T16:30:10Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-02-13T21:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7afb8886a05be68e376655539a064ec672de8a8e'/>
<id>urn:sha1:7afb8886a05be68e376655539a064ec672de8a8e</id>
<content type='text'>
Ignacy reported that when eth0 is down and add a vlan device
on top of it like:

  ip link add link eth0 name eth0.1 up type vlan id 1

We will get a refcount leak:

  unregister_netdevice: waiting for eth0.1 to become free. Usage count = 2

The problem is when rtnl_configure_link() fails in rtnl_newlink(),
we simply call unregister_device(), but for stacked device like vlan,
we almost do nothing when we unregister the upper device, more work
is done when we unregister the lower device, so call its -&gt;dellink().

Reported-by: Ignacy Gawedzki &lt;ignacy.gawedzki@green-communications.fr&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-02-09T22:35:57Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-02-09T22:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2573beec56aa28a0e6d4430fb6796d0c76308bcf'/>
<id>urn:sha1:2573beec56aa28a0e6d4430fb6796d0c76308bcf</id>
<content type='text'>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnetlink: ifla_vf_policy: fix misuses of NLA_BINARY</title>
<updated>2015-02-08T06:13:10Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2015-02-05T17:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=364d5716a7adb91b731a35765d369602d68d2881'/>
<id>urn:sha1:364d5716a7adb91b731a35765d369602d68d2881</id>
<content type='text'>
ifla_vf_policy[] is wrong in advertising its individual member types as
NLA_BINARY since .type = NLA_BINARY in combination with .len declares the
len member as *max* attribute length [0, len].

The issue is that when do_setvfinfo() is being called to set up a VF
through ndo handler, we could set corrupted data if the attribute length
is less than the size of the related structure itself.

The intent is exactly the opposite, namely to make sure to pass at least
data of minimum size of len.

Fixes: ebc08a6f47ee ("rtnetlink: Add VF config code to rtnetlink")
Cc: Mitch Williams &lt;mitch.a.williams@intel.com&gt;
Cc: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&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>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-02-05T22:33:28Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-02-05T22:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e03f896b52cd2ca88942170c5c9c407ec0ede69'/>
<id>urn:sha1:6e03f896b52cd2ca88942170c5c9c407ec0ede69</id>
<content type='text'>
Conflicts:
	drivers/net/vxlan.c
	drivers/vhost/net.c
	include/linux/if_vlan.h
	net/core/dev.c

The net/core/dev.c conflict was the overlap of one commit marking an
existing function static whilst another was adding a new function.

In the include/linux/if_vlan.h case, the type used for a local
variable was changed in 'net', whereas the function got rewritten
to fix a stacked vlan bug in 'net-next'.

In drivers/vhost/net.c, Al Viro's iov_iter conversions in 'net-next'
overlapped with an endainness fix for VHOST 1.0 in 'net'.

In drivers/net/vxlan.c, vxlan_find_vni() added a 'flags' parameter
in 'net-next' whereas in 'net' there was a bug fix to pass in the
correct network namespace pointer in calls to this function.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
