<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/ipv6/udp.c, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-12-16T22:26:56Z</updated>
<entry>
<title>net: fix nulls list corruptions in sk_prot_alloc</title>
<updated>2010-12-16T22:26:56Z</updated>
<author>
<name>Octavian Purdila</name>
</author>
<published>2010-12-16T22:26:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fcbdf09d9652c8919dcf47072e3ae7dcb4eb98ac'/>
<id>urn:sha1:fcbdf09d9652c8919dcf47072e3ae7dcb4eb98ac</id>
<content type='text'>
Special care is taken inside sk_port_alloc to avoid overwriting
skc_node/skc_nulls_node. We should also avoid overwriting
skc_bind_node/skc_portaddr_node.

The patch fixes the following crash:

 BUG: unable to handle kernel paging request at fffffffffffffff0
 IP: [&lt;ffffffff812ec6dd&gt;] udp4_lib_lookup2+0xad/0x370
 [&lt;ffffffff812ecc22&gt;] __udp4_lib_lookup+0x282/0x360
 [&lt;ffffffff812ed63e&gt;] __udp4_lib_rcv+0x31e/0x700
 [&lt;ffffffff812bba45&gt;] ? ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ? ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812eda35&gt;] udp_rcv+0x15/0x20
 [&lt;ffffffff812bba45&gt;] ip_local_deliver_finish+0x65/0x190
 [&lt;ffffffff812bbbf8&gt;] ip_local_deliver+0x88/0xa0
 [&lt;ffffffff812bb2cd&gt;] ip_rcv_finish+0x32d/0x6f0
 [&lt;ffffffff8128c14c&gt;] ? netif_receive_skb+0x99c/0x11c0
 [&lt;ffffffff812bb94b&gt;] ip_rcv+0x2bb/0x350
 [&lt;ffffffff8128c14c&gt;] netif_receive_skb+0x99c/0x11c0

Signed-off-by: Leonard Crestez &lt;lcrestez@ixiacom.com&gt;
Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add __rcu annotation to sk_filter</title>
<updated>2010-10-25T21:18:28Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-10-25T03:47:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d7da9ddd9a4eb7808698d04b98bf9d62d02649b'/>
<id>urn:sha1:0d7da9ddd9a4eb7808698d04b98bf9d62d02649b</id>
<content type='text'>
Add __rcu annotation to :
        (struct sock)-&gt;sk_filter

And use appropriate rcu primitives to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tproxy: added udp6_lib_lookup function</title>
<updated>2010-10-21T14:05:41Z</updated>
<author>
<name>Balazs Scheidler</name>
</author>
<published>2010-10-21T14:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa976fc011efa1f0e3290c6c9addf7c20757f885'/>
<id>urn:sha1:aa976fc011efa1f0e3290c6c9addf7c20757f885</id>
<content type='text'>
Just like with IPv4, we need access to the UDP hash table to look up local
sockets, but instead of exporting the global udp_table, export a lookup
function.

Signed-off-by: Balazs Scheidler &lt;bazsi@balabit.hu&gt;
Signed-off-by: KOVACS Krisztian &lt;hidden@balabit.hu&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>tproxy: added const specifiers to udp lookup functions</title>
<updated>2010-10-21T14:04:33Z</updated>
<author>
<name>Balazs Scheidler</name>
</author>
<published>2010-10-21T14:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88440ae70eda83d0cc94148d404f4990c9f1289c'/>
<id>urn:sha1:88440ae70eda83d0cc94148d404f4990c9f1289c</id>
<content type='text'>
The parameters for various UDP lookup functions were non-const, even though
they could be const. TProxy has some const references and instead of
downcasting it, I added const specifiers along the path.

Signed-off-by: Balazs Scheidler &lt;bazsi@balabit.hu&gt;
Signed-off-by: KOVACS Krisztian &lt;hidden@balabit.hu&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
</entry>
<entry>
<title>udp: add rehash on connect()</title>
<updated>2010-09-09T04:45:01Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-09-08T05:08:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=719f835853a92f6090258114a72ffe41f09155cd'/>
<id>urn:sha1:719f835853a92f6090258114a72ffe41f09155cd</id>
<content type='text'>
commit 30fff923 introduced in linux-2.6.33 (udp: bind() optimisation)
added a secondary hash on UDP, hashed on (local addr, local port).

Problem is that following sequence :

fd = socket(...)
connect(fd, &amp;remote, ...)

not only selects remote end point (address and port), but also sets
local address, while UDP stack stored in secondary hash table the socket
while its local address was INADDR_ANY (or ipv6 equivalent)

Sequence is :
 - autobind() : choose a random local port, insert socket in hash tables
              [while local address is INADDR_ANY]
 - connect() : set remote address and port, change local address to IP
              given by a route lookup.

When an incoming UDP frame comes, if more than 10 sockets are found in
primary hash table, we switch to secondary table, and fail to find
socket because its local address changed.

One solution to this problem is to rehash datagram socket if needed.

We add a new rehash(struct socket *) method in "struct proto", and
implement this method for UDP v4 &amp; v6, using a common helper.

This rehashing only takes care of secondary hash table, since primary
hash (based on local port only) is not changed.

Reported-by: Krzysztof Piotr Oledzki &lt;ole@ans.pl&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Tested-by: Krzysztof Piotr Oledzki &lt;ole@ans.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6</title>
<updated>2010-06-07T00:42:02Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2010-06-07T00:42:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eedc765ca4b19a41cf0b921a492ac08d640060d1'/>
<id>urn:sha1:eedc765ca4b19a41cf0b921a492ac08d640060d1</id>
<content type='text'>
Conflicts:
	drivers/net/sfc/net_driver.h
	drivers/net/sfc/siena.c
</content>
</entry>
<entry>
<title>ipv6: Refactor update of IPv6 flowi destination address for srcrt (RH) option</title>
<updated>2010-06-02T14:08:31Z</updated>
<author>
<name>Arnaud Ebalard</name>
</author>
<published>2010-06-01T21:35:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20c59de2e6b6bc74bbf714dcd4e720afe8d516cf'/>
<id>urn:sha1:20c59de2e6b6bc74bbf714dcd4e720afe8d516cf</id>
<content type='text'>
There are more than a dozen occurrences of following code in the
IPv6 stack:

    if (opt &amp;&amp; opt-&gt;srcrt) {
            struct rt0_hdr *rt0 = (struct rt0_hdr *) opt-&gt;srcrt;
            ipv6_addr_copy(&amp;final, &amp;fl.fl6_dst);
            ipv6_addr_copy(&amp;fl.fl6_dst, rt0-&gt;addr);
            final_p = &amp;final;
    }

Replace those with a helper. Note that the helper overrides final_p
in all cases. This is ok as final_p was previously initialized to
NULL when declared.

Signed-off-by: Arnaud Ebalard &lt;arno@natisbad.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sock_queue_err_skb() dont mess with sk_forward_alloc</title>
<updated>2010-06-01T06:44:05Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-06-01T06:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b1faf5666438090a4dc4fceac8502edc7788b7e3'/>
<id>urn:sha1:b1faf5666438090a4dc4fceac8502edc7788b7e3</id>
<content type='text'>
Correct sk_forward_alloc handling for error_queue would need to use a
backlog of frames that softirq handler could not deliver because socket
is owned by user thread. Or extend backlog processing to be able to
process normal and error packets.

Another possibility is to not use mem charge for error queue, this is
what I implemented in this patch.

Note: this reverts commit 29030374
(net: fix sk_forward_alloc corruptions), since we dont need to lock
socket anymore.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix sk_forward_alloc corruptions</title>
<updated>2010-05-29T07:20:48Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-05-29T07:20:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2903037400a26e7c0cc93ab75a7d62abfacdf485'/>
<id>urn:sha1:2903037400a26e7c0cc93ab75a7d62abfacdf485</id>
<content type='text'>
As David found out, sock_queue_err_skb() should be called with socket
lock hold, or we risk sk_forward_alloc corruption, since we use non
atomic operations to update this field.

This patch adds bh_lock_sock()/bh_unlock_sock() pair to three spots.
(BH already disabled)

1) skb_tstamp_tx() 
2) Before calling ip_icmp_error(), in __udp4_lib_err() 
3) Before calling ipv6_icmp_error(), in __udp6_lib_err()

Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix lock_sock_bh/unlock_sock_bh</title>
<updated>2010-05-27T07:30:53Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2010-05-26T19:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a74ad60a546b13bd1096b2a61a7a5c6fd9ae17c'/>
<id>urn:sha1:8a74ad60a546b13bd1096b2a61a7a5c6fd9ae17c</id>
<content type='text'>
This new sock lock primitive was introduced to speedup some user context
socket manipulation. But it is unsafe to protect two threads, one using
regular lock_sock/release_sock, one using lock_sock_bh/unlock_sock_bh

This patch changes lock_sock_bh to be careful against 'owned' state.
If owned is found to be set, we must take the slow path.
lock_sock_bh() now returns a boolean to say if the slow path was taken,
and this boolean is used at unlock_sock_bh time to call the appropriate
unlock function.

After this change, BH are either disabled or enabled during the
lock_sock_bh/unlock_sock_bh protected section. This might be misleading,
so we rename these functions to lock_sock_fast()/unlock_sock_fast().

Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Tested-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
