<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sctp/input.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>2011-02-09T21:15:38Z</updated>
<entry>
<title>sctp: Fix a race between ICMP protocol unreachable and connect()</title>
<updated>2011-02-09T21:15:38Z</updated>
<author>
<name>Vlad Yasevich</name>
</author>
<published>2010-05-06T07:56:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4746f7abc3f13246147e7f6c0d219876417001fa'/>
<id>urn:sha1:4746f7abc3f13246147e7f6c0d219876417001fa</id>
<content type='text'>
commit 50b5d6ad63821cea324a5a7a19854d4de1a0a819 upstream.

ICMP protocol unreachable handling completely disregarded
the fact that the user may have locked the socket.  It proceeded
to destroy the association, even though the user may have
held the lock and had a ref on the association.  This resulted
in the following:

Attempt to release alive inet socket f6afcc00

=========================
[ BUG: held lock freed! ]
-------------------------
somenu/2672 is freeing memory f6afcc00-f6afcfff, with a lock still held
there!
 (sk_lock-AF_INET){+.+.+.}, at: [&lt;c122098a&gt;] sctp_connect+0x13/0x4c
1 lock held by somenu/2672:
 #0:  (sk_lock-AF_INET){+.+.+.}, at: [&lt;c122098a&gt;] sctp_connect+0x13/0x4c

stack backtrace:
Pid: 2672, comm: somenu Not tainted 2.6.32-telco #55
Call Trace:
 [&lt;c1232266&gt;] ? printk+0xf/0x11
 [&lt;c1038553&gt;] debug_check_no_locks_freed+0xce/0xff
 [&lt;c10620b4&gt;] kmem_cache_free+0x21/0x66
 [&lt;c1185f25&gt;] __sk_free+0x9d/0xab
 [&lt;c1185f9c&gt;] sk_free+0x1c/0x1e
 [&lt;c1216e38&gt;] sctp_association_put+0x32/0x89
 [&lt;c1220865&gt;] __sctp_connect+0x36d/0x3f4
 [&lt;c122098a&gt;] ? sctp_connect+0x13/0x4c
 [&lt;c102d073&gt;] ? autoremove_wake_function+0x0/0x33
 [&lt;c12209a8&gt;] sctp_connect+0x31/0x4c
 [&lt;c11d1e80&gt;] inet_dgram_connect+0x4b/0x55
 [&lt;c11834fa&gt;] sys_connect+0x54/0x71
 [&lt;c103a3a2&gt;] ? lock_release_non_nested+0x88/0x239
 [&lt;c1054026&gt;] ? might_fault+0x42/0x7c
 [&lt;c1054026&gt;] ? might_fault+0x42/0x7c
 [&lt;c11847ab&gt;] sys_socketcall+0x6d/0x178
 [&lt;c10da994&gt;] ? trace_hardirqs_on_thunk+0xc/0x10
 [&lt;c1002959&gt;] syscall_call+0x7/0xb

This was because the sctp_wait_for_connect() would aqcure the socket
lock and then proceed to release the last reference count on the
association, thus cause the fully destruction path to finish freeing
the socket.

The simplest solution is to start a very short timer in case the socket
is owned by user.  When the timer expires, we can do some verification
and be able to do the release properly.

Signed-off-by: Vlad Yasevich &lt;vladislav.yasevich@hp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;

</content>
</entry>
<entry>
<title>sctp: Fix another socket race during accept/peeloff</title>
<updated>2009-02-12T17:31:23Z</updated>
<author>
<name>Vlad Yasevich</name>
</author>
<published>2009-01-22T22:53:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55ffc07a92e9ecc7f67ed85b0fac5abfb0d075b0'/>
<id>urn:sha1:55ffc07a92e9ecc7f67ed85b0fac5abfb0d075b0</id>
<content type='text'>
commit ae53b5bd77719fed58086c5be60ce4f22bffe1c6 upstream.

There is a race between sctp_rcv() and sctp_accept() where we
have moved the association from the listening socket to the
accepted socket, but sctp_rcv() processing cached the old
socket and continues to use it.

The easy solution is to check for the socket mismatch once we've
grabed the socket lock.  If we hit a mis-match, that means
that were are currently holding the lock on the listening socket,
but the association is refrencing a newly accepted socket.  We need
to drop the lock on the old socket and grab the lock on the new one.

A more proper solution might be to create accepted sockets when
the new association is established, similar to TCP.  That would
eliminate the race for 1-to-1 style sockets, but it would still
existing for 1-to-many sockets where a user wished to peeloff an
association.  For now, we'll live with this easy solution as
it addresses the problem.

Reported-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Reported-by: Karsten Keil &lt;kkeil@suse.de&gt;
Signed-off-by: Vlad Yasevich &lt;vladislav.yasevich@hp.com&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>sctp: remove unnecessary byteshifting, calculate directly in big-endian</title>
<updated>2008-07-19T06:07:09Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-07-19T06:07:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=336d3262df71fcd2661180bb35d5ea41b4cbca58'/>
<id>urn:sha1:336d3262df71fcd2661180bb35d5ea41b4cbca58</id>
<content type='text'>
Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: Vlad Yasevich &lt;vladislav.yasevich@hp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mib: add net to NET_INC_STATS_BH</title>
<updated>2008-07-17T03:31:16Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-07-17T03:31:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de0744af1fe2d0a3d428f6af0f2fe1f6179b1a9c'/>
<id>urn:sha1:de0744af1fe2d0a3d428f6af0f2fe1f6179b1a9c</id>
<content type='text'>
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>mib: add struct net to ICMP_INC_STATS_BH</title>
<updated>2008-07-15T06:05:29Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-07-15T06:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dcfc23cac103b54dbc00a6f52f47656ad5c75844'/>
<id>urn:sha1:dcfc23cac103b54dbc00a6f52f47656ad5c75844</id>
<content type='text'>
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>sctp: Validate Initiate Tag when handling ICMP message</title>
<updated>2008-06-19T23:07:48Z</updated>
<author>
<name>Wei Yongjun</name>
</author>
<published>2008-06-19T23:07:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7115e632f90952454ab6426e0d2151327162a30f'/>
<id>urn:sha1:7115e632f90952454ab6426e0d2151327162a30f</id>
<content type='text'>
This patch add to validate initiate tag and chunk type if verification
tag is 0 when handling ICMP message.

RFC 4960, Appendix C. ICMP Handling

ICMP6) An implementation MUST validate that the Verification Tag
contained in the ICMP message matches the Verification Tag of the peer.
If the Verification Tag is not 0 and does NOT match, discard the ICMP
message.  If it is 0 and the ICMP message contains enough bytes to
verify that the chunk type is an INIT chunk and that the Initiate Tag
matches the tag of the peer, continue with ICMP7.  If the ICMP message
is too short or the chunk type or the Initiate Tag does not match,
silently discard the packet.

Signed-off-by: Wei Yongjun &lt;yjwei@cn.fujitsu.com&gt;
Signed-off-by: Vlad Yasevich &lt;vladislav.yasevich@hp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>SCTP: Remove useless assignment from __sctp_rcv_lookup_endpoint</title>
<updated>2008-04-10T09:00:23Z</updated>
<author>
<name>Gui Jianfeng</name>
</author>
<published>2008-04-10T09:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eab2e0b2ec150aec8887d0cf178f7c989296266f'/>
<id>urn:sha1:eab2e0b2ec150aec8887d0cf178f7c989296266f</id>
<content type='text'>
Signed-off-by: Gui Jianfeng &lt;guijianfeng@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6</title>
<updated>2008-03-18T07:37:55Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2008-03-18T07:37:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=577f99c1d08cf9cbdafd4e858dd13ff04d855090'/>
<id>urn:sha1:577f99c1d08cf9cbdafd4e858dd13ff04d855090</id>
<content type='text'>
Conflicts:

	drivers/net/wireless/rt2x00/rt2x00dev.c
	net/8021q/vlan_dev.c
</content>
</entry>
<entry>
<title>[SCTP]: fix misannotated __sctp_rcv_asconf_lookup()</title>
<updated>2008-03-18T05:47:32Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-03-18T05:47:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc92dd194d05e8334b210552fbc0ac5711d72ea9'/>
<id>urn:sha1:bc92dd194d05e8334b210552fbc0ac5711d72ea9</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: replace remaining __FUNCTION__ occurrences</title>
<updated>2008-03-06T04:47:47Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-03-06T04:47:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0dc47877a3de00ceadea0005189656ae8dc52669'/>
<id>urn:sha1:0dc47877a3de00ceadea0005189656ae8dc52669</id>
<content type='text'>
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
