<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/net/inet_sock.h, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-03-18T02:02:29Z</updated>
<entry>
<title>inet: fix request sock refcounting</title>
<updated>2015-03-18T02:02:29Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-18T01:32:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0470c8ca1d57927f2cc3e1d5add1fb2834609447'/>
<id>urn:sha1:0470c8ca1d57927f2cc3e1d5add1fb2834609447</id>
<content type='text'>
While testing last patch series, I found req sock refcounting was wrong.

We must set skc_refcnt to 1 for all request socks added in hashes,
but also on request sockets created by FastOpen or syncookies.

It is tricky because we need to defer this initialization so that
future RCU lookups do not try to take a refcount on a not yet
fully initialized request socket.

Also get rid of ireq_refcnt alias.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Fixes: 13854e5a6046 ("inet: add proper refcounting to request sock")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: uninline inet_reqsk_alloc()</title>
<updated>2015-03-18T02:01:56Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-18T01:32:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e49bb337d77d54afebe4fe5b9008955e1337f83d'/>
<id>urn:sha1:e49bb337d77d54afebe4fe5b9008955e1337f83d</id>
<content type='text'>
inet_reqsk_alloc() is becoming fat and should not be inlined.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: add sk_listener argument to inet_reqsk_alloc()</title>
<updated>2015-03-18T02:01:55Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-18T01:32:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=407640de2152e33341ce1131dac269672c3d50f7'/>
<id>urn:sha1:407640de2152e33341ce1131dac269672c3d50f7</id>
<content type='text'>
listener socket can be used to set net pointer, and will
be later used to hold a reference on listener.

Add a const qualifier to first argument (struct request_sock_ops *),
and factorize all write_pnet(&amp;ireq-&gt;ireq_net, sock_net(sk));

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: move ir_mark to fill a hole</title>
<updated>2015-03-17T19:17:59Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-17T04:06:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=adc17d6a6ca08d11f70f6c49f3d40b87b68fe53f'/>
<id>urn:sha1:adc17d6a6ca08d11f70f6c49f3d40b87b68fe53f</id>
<content type='text'>
On 64bit arches, we can save 8 bytes in inet_request_sock
by moving ir_mark to fill a hole.

While we are at it, inet_request_mark() can get a const qualifier
for listener socket.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: add proper refcounting to request sock</title>
<updated>2015-03-16T19:55:29Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-16T04:12:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=13854e5a60461daee08ce99842b7f4d37553d911'/>
<id>urn:sha1:13854e5a60461daee08ce99842b7f4d37553d911</id>
<content type='text'>
reqsk_put() is the generic function that should be used
to release a refcount (and automatically call reqsk_free())

reqsk_free() might be called if refcount is known to be 0
or undefined.

refcnt is set to one in inet_csk_reqsk_queue_add()

As request socks are not yet in global ehash table,
I added temporary debugging checks in reqsk_put() and reqsk_free()

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: introduce ireq_family</title>
<updated>2015-03-13T02:58:13Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-12T23:44:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3f66b083a5b7f1a63540c24df3679c24f2e935a9'/>
<id>urn:sha1:3f66b083a5b7f1a63540c24df3679c24f2e935a9</id>
<content type='text'>
Before inserting request socks into general hash table,
fill their socket family.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: add rsk_refcnt/ireq_refcnt to request socks</title>
<updated>2015-03-13T02:58:13Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-12T23:44:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1e2e01172fd11b4dbfee746c0c8fbcaa9dbf22a0'/>
<id>urn:sha1:1e2e01172fd11b4dbfee746c0c8fbcaa9dbf22a0</id>
<content type='text'>
When request socks will be in ehash, they'll need to be refcounted.

This patch adds rsk_refcnt/ireq_refcnt macros, and adds
reqsk_put() function, but nothing yet use them.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: add ireq_state field to inet_request_sock</title>
<updated>2015-03-13T02:58:12Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-12T23:44:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d34ac51b76e8c7de6094cfb11780ef9c2b93469f'/>
<id>urn:sha1:d34ac51b76e8c7de6094cfb11780ef9c2b93469f</id>
<content type='text'>
We need to identify request sock when they'll be visible in
global ehash table.

ireq_state is an alias to req.__req_common.skc_state.

Its value is set to TCP_NEW_SYN_RECV

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: add missing ireq_net &amp; ir_cookie initializations</title>
<updated>2015-03-13T02:58:12Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-12T23:44:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd337c581b2b0d933d37f664bf55b342577fed3a'/>
<id>urn:sha1:bd337c581b2b0d933d37f664bf55b342577fed3a</id>
<content type='text'>
I forgot to update dccp_v6_conn_request() &amp; cookie_v6_check().
They both need to set ireq-&gt;ireq_net and ireq-&gt;ir_cookie

Lets clear ireq-&gt;ir_cookie in inet_reqsk_alloc()

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Fixes: 33cf7c90fe2f ("net: add real socket cookies")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add real socket cookies</title>
<updated>2015-03-12T01:55:28Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-12T01:53:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=33cf7c90fe2f97afb1cadaa0cfb782cb9d1b9ee2'/>
<id>urn:sha1:33cf7c90fe2f97afb1cadaa0cfb782cb9d1b9ee2</id>
<content type='text'>
A long standing problem in netlink socket dumps is the use
of kernel socket addresses as cookies.

1) It is a security concern.

2) Sockets can be reused quite quickly, so there is
   no guarantee a cookie is used once and identify
   a flow.

3) request sock, establish sock, and timewait socks
   for a given flow have different cookies.

Part of our effort to bring better TCP statistics requires
to switch to a different allocator.

In this patch, I chose to use a per network namespace 64bit generator,
and to use it only in the case a socket needs to be dumped to netlink.
(This might be refined later if needed)

Note that I tried to carry cookies from request sock, to establish sock,
then timewait sockets.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Eric Salo &lt;salo@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
