<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/core, branch v3.2.8-rt13</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>net: Avoid livelock in net_tx_action() on RT</title>
<updated>2012-02-15T16:33:02+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-10-06T14:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=378d25f8c1f5bcb55c6035ead788326ffc112d56'/>
<id>378d25f8c1f5bcb55c6035ead788326ffc112d56</id>
<content type='text'>
qdisc_lock is taken w/o disabling interrupts or bottom halfs. So code
holding a qdisc_lock() can be interrupted and softirqs can run on the
return of interrupt in !RT.

The spin_trylock() in net_tx_action() makes sure, that the softirq
does not deadlock. When the lock can't be acquired q is requeued and
the NET_TX softirq is raised. That causes the softirq to run over and
over.

That works in mainline as do_softirq() has a retry loop limit and
leaves the softirq processing in the interrupt return path and
schedules ksoftirqd. The task which holds qdisc_lock cannot be
preempted, so the lock is released and either ksoftirqd or the next
softirq in the return from interrupt path can proceed. Though it's a
bit strange to actually run MAX_SOFTIRQ_RESTART (10) loops before it
decides to bail out even if it's clear in the first iteration :)

On RT all softirq processing is done in a FIFO thread and we don't
have a loop limit, so ksoftirqd preempts the lock holder forever and
unqueues and requeues until the reset button is hit.

Due to the forced threading of ksoftirqd on RT we actually cannot
deadlock on qdisc_lock because it's a "sleeping lock". So it's safe to
replace the spin_trylock() with a spin_lock(). When contended,
ksoftirqd is scheduled out and the lock holder can proceed.

[ tglx: Massaged changelog and code comments ]

Solved-by: Thomas Gleixner &lt;tglx@linuxtronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Tested-by: Carsten Emde &lt;cbe@osadl.org&gt;
Cc: Clark Williams &lt;williams@redhat.com&gt;
Cc: John Kacur &lt;jkacur@redhat.com&gt;
Cc: Luis Claudio R. Goncalves &lt;lclaudio@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
qdisc_lock is taken w/o disabling interrupts or bottom halfs. So code
holding a qdisc_lock() can be interrupted and softirqs can run on the
return of interrupt in !RT.

The spin_trylock() in net_tx_action() makes sure, that the softirq
does not deadlock. When the lock can't be acquired q is requeued and
the NET_TX softirq is raised. That causes the softirq to run over and
over.

That works in mainline as do_softirq() has a retry loop limit and
leaves the softirq processing in the interrupt return path and
schedules ksoftirqd. The task which holds qdisc_lock cannot be
preempted, so the lock is released and either ksoftirqd or the next
softirq in the return from interrupt path can proceed. Though it's a
bit strange to actually run MAX_SOFTIRQ_RESTART (10) loops before it
decides to bail out even if it's clear in the first iteration :)

On RT all softirq processing is done in a FIFO thread and we don't
have a loop limit, so ksoftirqd preempts the lock holder forever and
unqueues and requeues until the reset button is hit.

Due to the forced threading of ksoftirqd on RT we actually cannot
deadlock on qdisc_lock because it's a "sleeping lock". So it's safe to
replace the spin_trylock() with a spin_lock(). When contended,
ksoftirqd is scheduled out and the lock holder can proceed.

[ tglx: Massaged changelog and code comments ]

Solved-by: Thomas Gleixner &lt;tglx@linuxtronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Tested-by: Carsten Emde &lt;cbe@osadl.org&gt;
Cc: Clark Williams &lt;williams@redhat.com&gt;
Cc: John Kacur &lt;jkacur@redhat.com&gt;
Cc: Luis Claudio R. Goncalves &lt;lclaudio@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>skbufhead-raw-lock.patch</title>
<updated>2012-02-15T16:33:00+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-07-12T13:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d80397e6268e7087b542d54bf267c5672865c589'/>
<id>d80397e6268e7087b542d54bf267c5672865c589</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net-netif_rx_ni-migrate-disable.patch</title>
<updated>2012-02-15T16:32:51+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-07-17T14:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=33960a4561fbe59cd1d1e3437211710298b85a7d'/>
<id>33960a4561fbe59cd1d1e3437211710298b85a7d</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>softirq-thread-do-softirq.patch</title>
<updated>2012-02-15T16:32:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-06-28T13:44:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=753aef4edb456a97b24f4bda4e36170877434d82'/>
<id>753aef4edb456a97b24f4bda4e36170877434d82</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net-flip-lock-dep-thingy.patch</title>
<updated>2012-02-15T16:32:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-06-28T08:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=369e7270e2e8bdfa60033f68a696e92e71b87f09'/>
<id>369e7270e2e8bdfa60033f68a696e92e71b87f09</id>
<content type='text'>
=======================================================
[ INFO: possible circular locking dependency detected ]
3.0.0-rc3+ #26
-------------------------------------------------------
ip/1104 is trying to acquire lock:
 (local_softirq_lock){+.+...}, at: [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68

but task is already holding lock:
 (sk_lock-AF_INET){+.+...}, at: [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-&gt; #1 (sk_lock-AF_INET){+.+...}:
       [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
       [&lt;ffffffff813e2781&gt;] lock_sock_nested+0x82/0x92
       [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12
       [&lt;ffffffff81433afa&gt;] tcp_close+0x1b/0x355
       [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
       [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
       [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
       [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
       [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
       [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
       [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (local_softirq_lock){+.+...}:
       [&lt;ffffffff81082ecc&gt;] __lock_acquire+0xacc/0xdc8
       [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
       [&lt;ffffffff814a7e40&gt;] _raw_spin_lock+0x3b/0x4a
       [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68
       [&lt;ffffffff81056d8b&gt;] local_bh_disable+0x36/0x3b
       [&lt;ffffffff814a7fc4&gt;] _raw_write_lock_bh+0x16/0x4f
       [&lt;ffffffff81433c38&gt;] tcp_close+0x159/0x355
       [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
       [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
       [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
       [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
       [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
       [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
       [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_INET);
                               lock(local_softirq_lock);
                               lock(sk_lock-AF_INET);
  lock(local_softirq_lock);

 *** DEADLOCK ***

1 lock held by ip/1104:
 #0:  (sk_lock-AF_INET){+.+...}, at: [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12

stack backtrace:
Pid: 1104, comm: ip Not tainted 3.0.0-rc3+ #26
Call Trace:
 [&lt;ffffffff81081649&gt;] print_circular_bug+0x1f8/0x209
 [&lt;ffffffff81082ecc&gt;] __lock_acquire+0xacc/0xdc8
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff81046c75&gt;] ? get_parent_ip+0x11/0x41
 [&lt;ffffffff814a7e40&gt;] _raw_spin_lock+0x3b/0x4a
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff81046c8c&gt;] ? get_parent_ip+0x28/0x41
 [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68
 [&lt;ffffffff81056d8b&gt;] local_bh_disable+0x36/0x3b
 [&lt;ffffffff81433308&gt;] ? lock_sock+0x10/0x12
 [&lt;ffffffff814a7fc4&gt;] _raw_write_lock_bh+0x16/0x4f
 [&lt;ffffffff81433c38&gt;] tcp_close+0x159/0x355
 [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
 [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
 [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
 [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
 [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
 [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
 [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b


Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
=======================================================
[ INFO: possible circular locking dependency detected ]
3.0.0-rc3+ #26
-------------------------------------------------------
ip/1104 is trying to acquire lock:
 (local_softirq_lock){+.+...}, at: [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68

but task is already holding lock:
 (sk_lock-AF_INET){+.+...}, at: [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-&gt; #1 (sk_lock-AF_INET){+.+...}:
       [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
       [&lt;ffffffff813e2781&gt;] lock_sock_nested+0x82/0x92
       [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12
       [&lt;ffffffff81433afa&gt;] tcp_close+0x1b/0x355
       [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
       [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
       [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
       [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
       [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
       [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
       [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (local_softirq_lock){+.+...}:
       [&lt;ffffffff81082ecc&gt;] __lock_acquire+0xacc/0xdc8
       [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
       [&lt;ffffffff814a7e40&gt;] _raw_spin_lock+0x3b/0x4a
       [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68
       [&lt;ffffffff81056d8b&gt;] local_bh_disable+0x36/0x3b
       [&lt;ffffffff814a7fc4&gt;] _raw_write_lock_bh+0x16/0x4f
       [&lt;ffffffff81433c38&gt;] tcp_close+0x159/0x355
       [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
       [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
       [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
       [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
       [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
       [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
       [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_INET);
                               lock(local_softirq_lock);
                               lock(sk_lock-AF_INET);
  lock(local_softirq_lock);

 *** DEADLOCK ***

1 lock held by ip/1104:
 #0:  (sk_lock-AF_INET){+.+...}, at: [&lt;ffffffff81433308&gt;] lock_sock+0x10/0x12

stack backtrace:
Pid: 1104, comm: ip Not tainted 3.0.0-rc3+ #26
Call Trace:
 [&lt;ffffffff81081649&gt;] print_circular_bug+0x1f8/0x209
 [&lt;ffffffff81082ecc&gt;] __lock_acquire+0xacc/0xdc8
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff810836e5&gt;] lock_acquire+0x103/0x12e
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff81046c75&gt;] ? get_parent_ip+0x11/0x41
 [&lt;ffffffff814a7e40&gt;] _raw_spin_lock+0x3b/0x4a
 [&lt;ffffffff81056d12&gt;] ? __local_lock+0x25/0x68
 [&lt;ffffffff81046c8c&gt;] ? get_parent_ip+0x28/0x41
 [&lt;ffffffff81056d12&gt;] __local_lock+0x25/0x68
 [&lt;ffffffff81056d8b&gt;] local_bh_disable+0x36/0x3b
 [&lt;ffffffff81433308&gt;] ? lock_sock+0x10/0x12
 [&lt;ffffffff814a7fc4&gt;] _raw_write_lock_bh+0x16/0x4f
 [&lt;ffffffff81433c38&gt;] tcp_close+0x159/0x355
 [&lt;ffffffff81453c99&gt;] inet_release+0xc3/0xcd
 [&lt;ffffffff813dff3f&gt;] sock_release+0x1f/0x74
 [&lt;ffffffff813dffbb&gt;] sock_close+0x27/0x2b
 [&lt;ffffffff81129c63&gt;] fput+0x11d/0x1e3
 [&lt;ffffffff81126577&gt;] filp_close+0x70/0x7b
 [&lt;ffffffff8112667a&gt;] sys_close+0xf8/0x13d
 [&lt;ffffffff814ae882&gt;] system_call_fastpath+0x16/0x1b


Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: reintroduce missing rcu_assign_pointer() calls</title>
<updated>2012-02-03T17:22:20+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2012-01-12T04:41:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4704f3edfdd3cc5918932577373c0dc165d52959'/>
<id>4704f3edfdd3cc5918932577373c0dc165d52959</id>
<content type='text'>
[ Upstream commit cf778b00e96df6d64f8e21b8395d1f8a859ecdc7 ]

commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
y).

We miss needed barriers, even on x86, when y is not NULL.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
CC: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit cf778b00e96df6d64f8e21b8395d1f8a859ecdc7 ]

commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
y).

We miss needed barriers, even on x86, when y is not NULL.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
CC: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netns: fix net_alloc_generic()</title>
<updated>2012-02-03T17:22:17+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2012-01-26T00:41:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a2c82f7bee1ffa9eafa1fb0bd886a7eea8c9e497'/>
<id>a2c82f7bee1ffa9eafa1fb0bd886a7eea8c9e497</id>
<content type='text'>
[ Upstream commit 073862ba5d249c20bd5c49fc6d904ff0e1f6a672 ]

When a new net namespace is created, we should attach to it a "struct
net_generic" with enough slots (even empty), or we can hit the following
BUG_ON() :

[  200.752016] kernel BUG at include/net/netns/generic.h:40!
...
[  200.752016]  [&lt;ffffffff825c3cea&gt;] ? get_cfcnfg+0x3a/0x180
[  200.752016]  [&lt;ffffffff821cf0b0&gt;] ? lockdep_rtnl_is_held+0x10/0x20
[  200.752016]  [&lt;ffffffff825c41be&gt;] caif_device_notify+0x2e/0x530
[  200.752016]  [&lt;ffffffff810d61b7&gt;] notifier_call_chain+0x67/0x110
[  200.752016]  [&lt;ffffffff810d67c1&gt;] raw_notifier_call_chain+0x11/0x20
[  200.752016]  [&lt;ffffffff821bae82&gt;] call_netdevice_notifiers+0x32/0x60
[  200.752016]  [&lt;ffffffff821c2b26&gt;] register_netdevice+0x196/0x300
[  200.752016]  [&lt;ffffffff821c2ca9&gt;] register_netdev+0x19/0x30
[  200.752016]  [&lt;ffffffff81c1c67a&gt;] loopback_net_init+0x4a/0xa0
[  200.752016]  [&lt;ffffffff821b5e62&gt;] ops_init+0x42/0x180
[  200.752016]  [&lt;ffffffff821b600b&gt;] setup_net+0x6b/0x100
[  200.752016]  [&lt;ffffffff821b6466&gt;] copy_net_ns+0x86/0x110
[  200.752016]  [&lt;ffffffff810d5789&gt;] create_new_namespaces+0xd9/0x190

net_alloc_generic() should take into account the maximum index into the
ptr array, as a subsystem might use net_generic() anytime.

This also reduces number of reallocations in net_assign_generic()

Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 073862ba5d249c20bd5c49fc6d904ff0e1f6a672 ]

When a new net namespace is created, we should attach to it a "struct
net_generic" with enough slots (even empty), or we can hit the following
BUG_ON() :

[  200.752016] kernel BUG at include/net/netns/generic.h:40!
...
[  200.752016]  [&lt;ffffffff825c3cea&gt;] ? get_cfcnfg+0x3a/0x180
[  200.752016]  [&lt;ffffffff821cf0b0&gt;] ? lockdep_rtnl_is_held+0x10/0x20
[  200.752016]  [&lt;ffffffff825c41be&gt;] caif_device_notify+0x2e/0x530
[  200.752016]  [&lt;ffffffff810d61b7&gt;] notifier_call_chain+0x67/0x110
[  200.752016]  [&lt;ffffffff810d67c1&gt;] raw_notifier_call_chain+0x11/0x20
[  200.752016]  [&lt;ffffffff821bae82&gt;] call_netdevice_notifiers+0x32/0x60
[  200.752016]  [&lt;ffffffff821c2b26&gt;] register_netdevice+0x196/0x300
[  200.752016]  [&lt;ffffffff821c2ca9&gt;] register_netdev+0x19/0x30
[  200.752016]  [&lt;ffffffff81c1c67a&gt;] loopback_net_init+0x4a/0xa0
[  200.752016]  [&lt;ffffffff821b5e62&gt;] ops_init+0x42/0x180
[  200.752016]  [&lt;ffffffff821b600b&gt;] setup_net+0x6b/0x100
[  200.752016]  [&lt;ffffffff821b6466&gt;] copy_net_ns+0x86/0x110
[  200.752016]  [&lt;ffffffff810d5789&gt;] create_new_namespaces+0xd9/0x190

net_alloc_generic() should take into account the maximum index into the
ptr array, as a subsystem might use net_generic() anytime.

This also reduces number of reallocations in net_assign_generic()

Reported-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Tested-by: Sasha Levin &lt;levinsasha928@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: relax rcvbuf limits</title>
<updated>2011-12-23T07:15:14+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-12-21T07:11:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0fd7bac6b6157eed6cf0cb86a1e88ba29e57c033'/>
<id>0fd7bac6b6157eed6cf0cb86a1e88ba29e57c033</id>
<content type='text'>
skb-&gt;truesize might be big even for a small packet.

Its even bigger after commit 87fb4b7b533 (net: more accurate skb
truesize) and big MTU.

We should allow queueing at least one packet per receiver, even with a
low RCVBUF setting.

Reported-by: Michal Simek &lt;monstr@monstr.eu&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
skb-&gt;truesize might be big even for a small packet.

Its even bigger after commit 87fb4b7b533 (net: more accurate skb
truesize) and big MTU.

We should allow queueing at least one packet per receiver, even with a
low RCVBUF setting.

Reported-by: Michal Simek &lt;monstr@monstr.eu&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rps: fix insufficient bounds checking in store_rps_dev_flow_table_cnt()</title>
<updated>2011-12-23T03:34:56+00:00</updated>
<author>
<name>Xi Wang</name>
<email>xi.wang@gmail.com</email>
</author>
<published>2011-12-22T13:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0a129f8b6cff54ab479324a54aefdab5db4f240'/>
<id>a0a129f8b6cff54ab479324a54aefdab5db4f240</id>
<content type='text'>
Setting a large rps_flow_cnt like (1 &lt;&lt; 30) on 32-bit platform will
cause a kernel oops due to insufficient bounds checking.

	if (count &gt; 1&lt;&lt;30) {
		/* Enforce a limit to prevent overflow */
		return -EINVAL;
	}
	count = roundup_pow_of_two(count);
	table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count));

Note that the macro RPS_DEV_FLOW_TABLE_SIZE(count) is defined as:

	... + (count * sizeof(struct rps_dev_flow))

where sizeof(struct rps_dev_flow) is 8.  (1 &lt;&lt; 30) * 8 will overflow
32 bits.

This patch replaces the magic number (1 &lt;&lt; 30) with a symbolic bound.

Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Setting a large rps_flow_cnt like (1 &lt;&lt; 30) on 32-bit platform will
cause a kernel oops due to insufficient bounds checking.

	if (count &gt; 1&lt;&lt;30) {
		/* Enforce a limit to prevent overflow */
		return -EINVAL;
	}
	count = roundup_pow_of_two(count);
	table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count));

Note that the macro RPS_DEV_FLOW_TABLE_SIZE(count) is defined as:

	... + (count * sizeof(struct rps_dev_flow))

where sizeof(struct rps_dev_flow) is 8.  (1 &lt;&lt; 30) * 8 will overflow
32 bits.

This patch replaces the magic number (1 &lt;&lt; 30) with a symbolic bound.

Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Add a flow_cache_flush_deferred function</title>
<updated>2011-12-21T21:48:08+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2011-12-21T21:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e'/>
<id>c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e</id>
<content type='text'>
flow_cach_flush() might sleep but can be called from
atomic context via the xfrm garbage collector. So add
a flow_cache_flush_deferred() function and use this if
the xfrm garbage colector is invoked from within the
packet path.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Acked-by: Timo Teräs &lt;timo.teras@iki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flow_cach_flush() might sleep but can be called from
atomic context via the xfrm garbage collector. So add
a flow_cache_flush_deferred() function and use this if
the xfrm garbage colector is invoked from within the
packet path.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Acked-by: Timo Teräs &lt;timo.teras@iki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
