<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/net/dccp, branch v3.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-12-14T18:14:07Z</updated>
<entry>
<title>inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock</title>
<updated>2012-12-14T18:14:07Z</updated>
<author>
<name>Christoph Paasch</name>
<email>christoph.paasch@uclouvain.be</email>
</author>
<published>2012-12-14T04:07:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e337e24d6624e74a558aa69071e112a65f7b5758'/>
<id>urn:sha1:e337e24d6624e74a558aa69071e112a65f7b5758</id>
<content type='text'>
If in either of the above functions inet_csk_route_child_sock() or
__inet_inherit_port() fails, the newsk will not be freed:

unreferenced object 0xffff88022e8a92c0 (size 1592):
  comm "softirq", pid 0, jiffies 4294946244 (age 726.160s)
  hex dump (first 32 bytes):
    0a 01 01 01 0a 01 01 02 00 00 00 00 a7 cc 16 00  ................
    02 00 03 01 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8153d190&gt;] kmemleak_alloc+0x21/0x3e
    [&lt;ffffffff810ab3e7&gt;] kmem_cache_alloc+0xb5/0xc5
    [&lt;ffffffff8149b65b&gt;] sk_prot_alloc.isra.53+0x2b/0xcd
    [&lt;ffffffff8149b784&gt;] sk_clone_lock+0x16/0x21e
    [&lt;ffffffff814d711a&gt;] inet_csk_clone_lock+0x10/0x7b
    [&lt;ffffffff814ebbc3&gt;] tcp_create_openreq_child+0x21/0x481
    [&lt;ffffffff814e8fa5&gt;] tcp_v4_syn_recv_sock+0x3a/0x23b
    [&lt;ffffffff814ec5ba&gt;] tcp_check_req+0x29f/0x416
    [&lt;ffffffff814e8e10&gt;] tcp_v4_do_rcv+0x161/0x2bc
    [&lt;ffffffff814eb917&gt;] tcp_v4_rcv+0x6c9/0x701
    [&lt;ffffffff814cea9f&gt;] ip_local_deliver_finish+0x70/0xc4
    [&lt;ffffffff814cec20&gt;] ip_local_deliver+0x4e/0x7f
    [&lt;ffffffff814ce9f8&gt;] ip_rcv_finish+0x1fc/0x233
    [&lt;ffffffff814cee68&gt;] ip_rcv+0x217/0x267
    [&lt;ffffffff814a7bbe&gt;] __netif_receive_skb+0x49e/0x553
    [&lt;ffffffff814a7cc3&gt;] netif_receive_skb+0x50/0x82

This happens, because sk_clone_lock initializes sk_refcnt to 2, and thus
a single sock_put() is not enough to free the memory. Additionally, things
like xfrm, memcg, cookie_values,... may have been initialized.
We have to free them properly.

This is fixed by forcing a call to tcp_done(), ending up in
inet_csk_destroy_sock, doing the final sock_put(). tcp_done() is necessary,
because it ends up doing all the cleanup on xfrm, memcg, cookie_values,
xfrm,...

Before calling tcp_done, we have to set the socket to SOCK_DEAD, to
force it entering inet_csk_destroy_sock. To avoid the warning in
inet_csk_destroy_sock, inet_num has to be set to 0.
As inet_csk_destroy_sock does a dec on orphan_count, we first have to
increase it.

Calling tcp_done() allows us to remove the calls to
tcp_clear_xmit_timer() and tcp_cleanup_congestion_control().

A similar approach is taken for dccp by calling dccp_done().

This is in the kernel since 093d282321 (tproxy: fix hash locking issue
when using port redirection in __inet_inherit_port()), thus since
version &gt;= 2.6.37.

Signed-off-by: Christoph Paasch &lt;christoph.paasch@uclouvain.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: better retrans tracking for defer-accept</title>
<updated>2012-11-03T18:45:00Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-10-27T23:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e6c022a4fa2d2d9ca9d0a7ac3b05ad988f39fc30'/>
<id>urn:sha1:e6c022a4fa2d2d9ca9d0a7ac3b05ad988f39fc30</id>
<content type='text'>
For passive TCP connections using TCP_DEFER_ACCEPT facility,
we incorrectly increment req-&gt;retrans each time timeout triggers
while no SYNACK is sent.

SYNACK are not sent for TCP_DEFER_ACCEPT that were established (for
which we received the ACK from client). Only the last SYNACK is sent
so that we can receive again an ACK from client, to move the req into
accept queue. We plan to change this later to avoid the useless
retransmit (and potential problem as this SYNACK could be lost)

TCP_INFO later gives wrong information to user, claiming imaginary
retransmits.

Decouple req-&gt;retrans field into two independent fields :

num_retrans : number of retransmit
num_timeout : number of timeouts

num_timeout is the counter that is incremented at each timeout,
regardless of actual SYNACK being sent or not, and used to
compute the exponential timeout.

Introduce inet_rtx_syn_ack() helper to increment num_retrans
only if -&gt;rtx_syn_ack() succeeded.

Use inet_rtx_syn_ack() from tcp_check_req() to increment num_retrans
when we re-send a SYNACK in answer to a (retransmitted) SYN.
Prior to this patch, we were not counting these retransmits.

Change tcp_v[46]_rtx_synack() to increment TCP_MIB_RETRANSSEGS
only if a synack packet was successfully queued.

Reported-by: Yuchung Cheng &lt;ycheng@google.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Julian Anastasov &lt;ja@ssi.bg&gt;
Cc: Vijay Subramanian &lt;subramanian.vijay@gmail.com&gt;
Cc: Elliott Hughes &lt;enh@google.com&gt;
Cc: Neal Cardwell &lt;ncardwell@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO)</title>
<updated>2012-08-16T04:36:31Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2012-08-15T11:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b07f8eb75aa3097cdfd4f6eac3da49db787381d'/>
<id>urn:sha1:7b07f8eb75aa3097cdfd4f6eac3da49db787381d</id>
<content type='text'>
The CCID3 code fails to initialize the trailing padding bytes of struct
tfrc_tx_info added for alignment on 64 bit architectures. It that for
potentially leaks four bytes kernel stack via the getsockopt() syscall.
Add an explicit memset(0) before filling the structure to avoid the
info leak.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>dccp: check ccid before dereferencing</title>
<updated>2012-08-16T04:36:31Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2012-08-15T11:31:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=276bdb82dedb290511467a5a4fdbe9f0b52dce6f'/>
<id>urn:sha1:276bdb82dedb290511467a5a4fdbe9f0b52dce6f</id>
<content type='text'>
ccid_hc_rx_getsockopt() and ccid_hc_tx_getsockopt() might be called with
a NULL ccid pointer leading to a NULL pointer dereference. This could
lead to a privilege escalation if the attacker is able to map page 0 and
prepare it with a fake ccid_ops pointer.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: Prepare for change of rt-&gt;rt_iif encoding.</title>
<updated>2012-07-23T23:36:26Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-23T23:29:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=92101b3b2e3178087127709a556b091dae314e9e'/>
<id>urn:sha1:92101b3b2e3178087127709a556b091dae314e9e</id>
<content type='text'>
Use inet_iif() consistently, and for TCP record the input interface of
cached RX dst in inet sock.

rt-&gt;rt_iif is going to be encoded differently, so that we can
legitimately cache input routes in the FIB info more aggressively.

When the input interface is "use SKB device index" the rt-&gt;rt_iif will
be set to zero.

This forces us to move the TCP RX dst cache installation into the ipv4
specific code, and as well it should since doing the route caching for
ipv6 is pointless at the moment since it is not inspected in the ipv6
input paths yet.

Also, remove the unlikely on dst-&gt;obsolete, all ipv4 dsts have
obsolete set to a non-zero value to force invocation of the check
callback.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: Kill FLOWI_FLAG_RT_NOCACHE and associated code.</title>
<updated>2012-07-20T20:36:54Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-17T21:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba3f7f04ef2b19aace38f855aedd17fe43035d50'/>
<id>urn:sha1:ba3f7f04ef2b19aace38f855aedd17fe43035d50</id>
<content type='text'>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Pass optional SKB and SK arguments to dst_ops-&gt;{update_pmtu,redirect}()</title>
<updated>2012-07-17T10:29:28Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-17T10:29:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6700c2709c08d74ae2c3c29b84a30da012dbc7f1'/>
<id>urn:sha1:6700c2709c08d74ae2c3c29b84a30da012dbc7f1</id>
<content type='text'>
This will be used so that we can compose a full flow key.

Even though we have a route in this context, we need more.  In the
future the routes will be without destination address, source address,
etc. keying.  One ipv4 route will cover entire subnets, etc.

In this environment we have to have a way to possess persistent storage
for redirects and PMTU information.  This persistent storage will exist
in the FIB tables, and that's why we'll need to be able to rebuild a
full lookup flow key here.  Using that flow key will do a fib_lookup()
and create/update the persistent entry.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Add helper inet6_csk_update_pmtu().</title>
<updated>2012-07-16T10:44:56Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-16T10:44:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=35ad9b9cf7d8a2e6259a0d24022e910adb6f3489'/>
<id>urn:sha1:35ad9b9cf7d8a2e6259a0d24022e910adb6f3489</id>
<content type='text'>
This is the ipv6 version of inet_csk_update_pmtu().

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: Add helper inet_csk_update_pmtu().</title>
<updated>2012-07-16T10:28:06Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-16T10:28:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=80d0a69fc57715dc9080c0567df1ed911b78abea'/>
<id>urn:sha1:80d0a69fc57715dc9080c0567df1ed911b78abea</id>
<content type='text'>
This abstracts away the call to dst_ops-&gt;update_pmtu() so that we can
transparently handle the fact that, in the future, the dst itself can
be invalidated by the PMTU update (when we have non-host routes cached
in sockets).

So we try to rebuild the socket cached route after the method
invocation if necessary.

This isn't used by SCTP because it needs to cache dsts per-transport,
and thus will need it's own local version of this helper.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Remove checks for dst_ops-&gt;redirect being NULL.</title>
<updated>2012-07-12T07:41:25Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-07-12T07:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1ed5c48f231cd00eac0b3d2350ac61e3c825063e'/>
<id>urn:sha1:1ed5c48f231cd00eac0b3d2350ac61e3c825063e</id>
<content type='text'>
No longer necessary.

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