<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/core/net_namespace.c, branch linux-2.6.27.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.27.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.27.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-09-15T17:37:21Z</updated>
<entry>
<title>net: net_assign_generic() fix</title>
<updated>2009-09-15T17:37:21Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2009-07-28T02:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52238af23c7afb11cad5978f0434036f494f1b00'/>
<id>urn:sha1:52238af23c7afb11cad5978f0434036f494f1b00</id>
<content type='text'>
[ Upstream commit 144586301f6af5ae5943a002f030d8c626fa4fdd ]

memcpy() should take into account size of pointers,
not only number of pointers to copy.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: 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@suse.de&gt;
</content>
</entry>
<entry>
<title>netns: Don't receive new packets in a dead network namespace.</title>
<updated>2008-06-21T05:16:51Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2008-06-21T05:16:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b9f75f45a6b46a0ab4eb0857d437a0845871f314'/>
<id>urn:sha1:b9f75f45a6b46a0ab4eb0857d437a0845871f314</id>
<content type='text'>
Alexey Dobriyan &lt;adobriyan@gmail.com&gt; writes:
&gt; Subject: ICMP sockets destruction vs ICMP packets oops

&gt; After icmp_sk_exit() nuked ICMP sockets, we get an interrupt.
&gt; icmp_reply() wants ICMP socket.
&gt;
&gt; Steps to reproduce:
&gt;
&gt; 	launch shell in new netns
&gt; 	move real NIC to netns
&gt; 	setup routing
&gt; 	ping -i 0
&gt; 	exit from shell
&gt;
&gt; BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
&gt; IP: [&lt;ffffffff803fce17&gt;] icmp_sk+0x17/0x30
&gt; PGD 17f3cd067 PUD 17f3ce067 PMD 0 
&gt; Oops: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
&gt; CPU 0 
&gt; Modules linked in: usblp usbcore
&gt; Pid: 0, comm: swapper Not tainted 2.6.26-rc6-netns-ct #4
&gt; RIP: 0010:[&lt;ffffffff803fce17&gt;]  [&lt;ffffffff803fce17&gt;] icmp_sk+0x17/0x30
&gt; RSP: 0018:ffffffff8057fc30  EFLAGS: 00010286
&gt; RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff81017c7db900
&gt; RDX: 0000000000000034 RSI: ffff81017c7db900 RDI: ffff81017dc41800
&gt; RBP: ffffffff8057fc40 R08: 0000000000000001 R09: 000000000000a815
&gt; R10: 0000000000000000 R11: 0000000000000001 R12: ffffffff8057fd28
&gt; R13: ffffffff8057fd00 R14: ffff81017c7db938 R15: ffff81017dc41800
&gt; FS:  0000000000000000(0000) GS:ffffffff80525000(0000) knlGS:0000000000000000
&gt; CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
&gt; CR2: 0000000000000000 CR3: 000000017fcda000 CR4: 00000000000006e0
&gt; DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt; DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
&gt; Process swapper (pid: 0, threadinfo ffffffff8053a000, task ffffffff804fa4a0)
&gt; Stack:  0000000000000000 ffff81017c7db900 ffffffff8057fcf0 ffffffff803fcfe4
&gt;  ffffffff804faa38 0000000000000246 0000000000005a40 0000000000000246
&gt;  000000000001ffff ffff81017dd68dc0 0000000000005a40 0000000055342436
&gt; Call Trace:
&gt;  &lt;IRQ&gt;  [&lt;ffffffff803fcfe4&gt;] icmp_reply+0x44/0x1e0
&gt;  [&lt;ffffffff803d3a0a&gt;] ? ip_route_input+0x23a/0x1360
&gt;  [&lt;ffffffff803fd645&gt;] icmp_echo+0x65/0x70
&gt;  [&lt;ffffffff803fd300&gt;] icmp_rcv+0x180/0x1b0
&gt;  [&lt;ffffffff803d6d84&gt;] ip_local_deliver+0xf4/0x1f0
&gt;  [&lt;ffffffff803d71bb&gt;] ip_rcv+0x33b/0x650
&gt;  [&lt;ffffffff803bb16a&gt;] netif_receive_skb+0x27a/0x340
&gt;  [&lt;ffffffff803be57d&gt;] process_backlog+0x9d/0x100
&gt;  [&lt;ffffffff803bdd4d&gt;] net_rx_action+0x18d/0x250
&gt;  [&lt;ffffffff80237be5&gt;] __do_softirq+0x75/0x100
&gt;  [&lt;ffffffff8020c97c&gt;] call_softirq+0x1c/0x30
&gt;  [&lt;ffffffff8020f085&gt;] do_softirq+0x65/0xa0
&gt;  [&lt;ffffffff80237af7&gt;] irq_exit+0x97/0xa0
&gt;  [&lt;ffffffff8020f198&gt;] do_IRQ+0xa8/0x130
&gt;  [&lt;ffffffff80212ee0&gt;] ? mwait_idle+0x0/0x60
&gt;  [&lt;ffffffff8020bc46&gt;] ret_from_intr+0x0/0xf
&gt;  &lt;EOI&gt;  [&lt;ffffffff80212f2c&gt;] ? mwait_idle+0x4c/0x60
&gt;  [&lt;ffffffff80212f23&gt;] ? mwait_idle+0x43/0x60
&gt;  [&lt;ffffffff8020a217&gt;] ? cpu_idle+0x57/0xa0
&gt;  [&lt;ffffffff8040f380&gt;] ? rest_init+0x70/0x80
&gt; Code: 10 5b 41 5c 41 5d 41 5e c9 c3 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 53
&gt; 48 83 ec 08 48 8b 9f 78 01 00 00 e8 2b c7 f1 ff 89 c0 &lt;48&gt; 8b 04 c3 48 83 c4 08
&gt; 5b c9 c3 66 66 66 66 66 2e 0f 1f 84 00
&gt; RIP  [&lt;ffffffff803fce17&gt;] icmp_sk+0x17/0x30
&gt;  RSP &lt;ffffffff8057fc30&gt;
&gt; CR2: 0000000000000000
&gt; ---[ end trace ea161157b76b33e8 ]---
&gt; Kernel panic - not syncing: Aiee, killing interrupt handler!

Receiving packets while we are cleaning up a network namespace is a
racy proposition. It is possible when the packet arrives that we have
removed some but not all of the state we need to fully process it.  We
have the choice of either playing wack-a-mole with the cleanup routines
or simply dropping packets when we don't have a network namespace to
handle them.

Since the check looks inexpensive in netif_receive_skb let's just
drop the incoming packets.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NETNS]: Make netns refconting debug like a socket one.</title>
<updated>2008-04-16T08:58:04Z</updated>
<author>
<name>Denis V. Lunev</name>
</author>
<published>2008-04-16T08:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d1e4468a7705db7c1415a65fd16f07113afc1b2'/>
<id>urn:sha1:5d1e4468a7705db7c1415a65fd16f07113afc1b2</id>
<content type='text'>
Make release_net/hold_net noop for performance-hungry people. This is a debug
staff and should be used in the debug mode only.

Add check for net != NULL in hold/release calls. This will be required
later on.

[ Added minor simplifications suggested by Brian Haley. -DaveM ]

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NETNS]: The generic per-net pointers.</title>
<updated>2008-04-15T07:36:08Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-04-15T07:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dec827d174d7f76c457238800183ca864a639365'/>
<id>urn:sha1:dec827d174d7f76c457238800183ca864a639365</id>
<content type='text'>
Add the elastic array of void * pointer to the struct net.
The access rules are simple:

 1. register the ops with register_pernet_gen_device to get
    the id of your private pointer
 2. call net_assign_generic() to put the private data on the
    struct net (most preferably this should be done in the
    -&gt;init callback of the ops registered)
 3. do not store any private reference on the net_generic array;
 4. do not change this pointer while the net is alive;
 5. use the net_generic() to get the pointer.

When adding a new pointer, I copy the old array, replace it
with a new one and schedule the old for kfree after an RCU
grace period.

Since the net_generic explores the net-&gt;gen array inside rcu
read section and once set the net-&gt;gen-&gt;ptr[x] pointer never 
changes, this grants us a safe access to generic pointers.

Quoting Paul: "... RCU is protecting -only- the net_generic 
structure that net_generic() is traversing, and the [pointer]
returned by net_generic() is protected by a reference counter 
in the upper-level struct net."

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NETNS]: The net-subsys IDs generator.</title>
<updated>2008-04-15T07:35:23Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-04-15T07:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c93cf61fd1d5378134f9b06703f7078067542e00'/>
<id>urn:sha1:c93cf61fd1d5378134f9b06703f7078067542e00</id>
<content type='text'>
To make some per-net generic pointers, we need some way to address
them, i.e. - IDs. This is simple IDA-based IDs generator for pernet
subsystems.

Addressing questions about potential checkpoint/restart problems: 
these IDs are "lite-offsets" within the net structure and are by no 
means supposed to be exported to the userspace.

Since it will be used in the nearest future by devices only (tun,
vlan, tunnels, bridge, etc), I make it resemble the functionality
of register_pernet_device().

The new ids is stored in the *id pointer _before_ calling the init
callback to make this id available in this callback.

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>typo fixes in net/core/net_namespace.c</title>
<updated>2008-02-03T15:56:48Z</updated>
<author>
<name>Oliver Pinter</name>
</author>
<published>2008-02-03T15:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53379e57a7705e2946c8d77d09a57a169097a6fe'/>
<id>urn:sha1:53379e57a7705e2946c8d77d09a57a169097a6fe</id>
<content type='text'>
Signed-off-by: Oliver Pinter &lt;oliver.pntr@gmail.com&gt;
Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
</content>
</entry>
<entry>
<title>[NET]: Make netns cleanup to run in a separate queue</title>
<updated>2008-01-28T22:54:35Z</updated>
<author>
<name>Benjamin Thery</name>
</author>
<published>2007-11-20T07:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ef1355dcb8551730cc71e9ef4363f5c66ccad17'/>
<id>urn:sha1:3ef1355dcb8551730cc71e9ef4363f5c66ccad17</id>
<content type='text'>
This patch adds a separate workqueue for cleaning up a network
namespace. If we use the keventd workqueue to execute cleanup_net(),
there is a problem to unregister devices in IPv6. Indeed the code
that cleans up also schedule work in keventd: as long as cleanup_net()
hasn't return, dst_gc_task() cannot run and as long as dst_gc_task() has
not run, there are still some references pending on the net devices and
cleanup_net() can not unregister and exit the keventd workqueue.

Signed-off-by: Benjamin Thery &lt;benjamin.thery@bull.net&gt;
Signed-off-by: Daniel Lezcano &lt;dlezcano@fr.ibm.com&gt;
Acked-by: Denis V. Lunev &lt;den@openvz.org&gt;
Acked-By: Kirill Korotaev &lt;dev@sw.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NETNS]: Re-export init_net via EXPORT_SYMBOL.</title>
<updated>2008-01-23T11:11:42Z</updated>
<author>
<name>Denis V. Lunev</name>
</author>
<published>2008-01-23T06:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff4b950277b6534caab2b2b956dba6ce29757551'/>
<id>urn:sha1:ff4b950277b6534caab2b2b956dba6ce29757551</id>
<content type='text'>
init_net is used added as a parameter to a lot of old API calls, f.e.
ip_dev_find. These calls were exported as EXPORT_SYMBOL. So, export init_net
as EXPORT_SYMBOL to keep networking API consistent.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NET]: Cleanup pernet operation without CONFIG_NET_NS</title>
<updated>2007-11-13T11:23:21Z</updated>
<author>
<name>Denis V. Lunev</name>
</author>
<published>2007-11-13T11:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed160e839d2e1118529e58b04d52dba703ca629c'/>
<id>urn:sha1:ed160e839d2e1118529e58b04d52dba703ca629c</id>
<content type='text'>
If CONFIG_NET_NS is not set, the only namespace is possible.

This patch removes list of pernet_operations and cleanups code a bit.
This list is not needed if there are no namespaces. We should just call
-&gt;init method.

Additionally, the -&gt;exit will be called on module unloading only. This
case is safe - the code is not discarded. For the in/kernel code, -&gt;exit
should never be called.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[NETNS]: Fix compiler error in net_namespace.c</title>
<updated>2007-11-07T12:15:02Z</updated>
<author>
<name>Johann Felix Soden</name>
</author>
<published>2007-11-07T09:30:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45a19b0a725a04f3255d9d3da1fca30bb97f1481'/>
<id>urn:sha1:45a19b0a725a04f3255d9d3da1fca30bb97f1481</id>
<content type='text'>
Because net_free is called by copy_net_ns before its declaration, the
compiler gives an error. This patch puts net_free before copy_net_ns
to fix this.

The compiler error:
net/core/net_namespace.c: In function 'copy_net_ns':
net/core/net_namespace.c:97: error: implicit declaration of function 'net_free'
net/core/net_namespace.c: At top level:
net/core/net_namespace.c:104: warning: conflicting types for 'net_free'
net/core/net_namespace.c:104: error: static declaration of 'net_free' follows non-static declaration
net/core/net_namespace.c:97: error: previous implicit declaration of 'net_free' was here

The error was introduced by the '[NET]: Hide the dead code in the
net_namespace.c' patch (6a1a3b9f686bb04820a232cc1657ef2c45670709).

Signed-off-by: Johann Felix Soden &lt;johfel@users.sourceforge.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
