<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc/socket.c, branch v4.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-06-11T05:05:20Z</updated>
<entry>
<title>tipc: disconnect socket directly after probe failure</title>
<updated>2015-06-11T05:05:20Z</updated>
<author>
<name>Erik Hugne</name>
<email>erik.hugne@ericsson.com</email>
</author>
<published>2015-06-09T15:27:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3be5e3e726a6cc849f40c70c3ae525e4146e9df'/>
<id>urn:sha1:b3be5e3e726a6cc849f40c70c3ae525e4146e9df</id>
<content type='text'>
If the TIPC connection timer expires in a probing state, a
self abort message is supposed to be generated and delivered
to the local socket. This is currently broken, and the abort
message is actually sent out to the peer node with invalid
addressing information. This will cause the link to enter
a constant retransmission state and eventually reset.
We fix this by removing the self-abort message creation and
tear down connection immediately instead.

Signed-off-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix random link reset problem</title>
<updated>2015-04-23T15:50:34Z</updated>
<author>
<name>Erik Hugne</name>
<email>erik.hugne@ericsson.com</email>
</author>
<published>2015-04-23T13:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9871b27f6705fc6e0ba633b136369a289b2bfb99'/>
<id>urn:sha1:9871b27f6705fc6e0ba633b136369a289b2bfb99</id>
<content type='text'>
In the function tipc_sk_rcv(), the stack variable 'err'
is only initialized to TIPC_ERR_NO_PORT for the first
iteration over the link input queue. If a chain of messages
are received from a link, failure to lookup the socket for
any but the first message will cause the message to bounce back
out on a random link.
We fix this by properly initializing err.

Signed-off-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rhashtable: Disable automatic shrinking by default</title>
<updated>2015-03-24T21:48:40Z</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@suug.ch</email>
</author>
<published>2015-03-24T20:42:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b5e2c150ac914f28a28833b57397bec0b0a2bd5f'/>
<id>urn:sha1:b5e2c150ac914f28a28833b57397bec0b0a2bd5f</id>
<content type='text'>
Introduce a new bool automatic_shrinking to require the
user to explicitly opt-in to automatic shrinking of tables.

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: validate length of sockaddr in connect() for dgram/rdm</title>
<updated>2015-03-24T16:50:39Z</updated>
<author>
<name>Sasha Levin</name>
<email>sasha.levin@oracle.com</email>
</author>
<published>2015-03-23T19:30:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=610600c8c5e25d551a010b64412cf731c084b1e1'/>
<id>urn:sha1:610600c8c5e25d551a010b64412cf731c084b1e1</id>
<content type='text'>
Commit f2f8036 ("tipc: add support for connect() on dgram/rdm sockets")
hasn't validated user input length for the sockaddr structure which allows
a user to overwrite kernel memory with arbitrary input.

Fixes: f2f8036 ("tipc: add support for connect() on dgram/rdm sockets")
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: Use default rhashtable hashfn</title>
<updated>2015-03-24T02:07:51Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2015-03-23T13:50:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d022949810b1ea82d46a576d6166035720bbb32'/>
<id>urn:sha1:6d022949810b1ea82d46a576d6166035720bbb32</id>
<content type='text'>
This patch removes the explicit jhash value for the hashfn parameter
of rhashtable.  The default is now jhash so removing the setting
makes no difference apart from making one less copy of jhash in
the kernel.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: Use inlined rhashtable interface</title>
<updated>2015-03-20T20:16:24Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2015-03-20T10:57:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6cca7289d5cba80d61da711205cd230fc637e2e3'/>
<id>urn:sha1:6cca7289d5cba80d61da711205cd230fc637e2e3</id>
<content type='text'>
This patch converts tipc to the inlined rhashtable interface.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: add support for connect() on dgram/rdm sockets</title>
<updated>2015-03-19T16:25:54Z</updated>
<author>
<name>Erik Hugne</name>
<email>erik.hugne@ericsson.com</email>
</author>
<published>2015-03-19T08:02:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2f8036e391eb82ee78764483f869f2feafb5da8'/>
<id>urn:sha1:f2f8036e391eb82ee78764483f869f2feafb5da8</id>
<content type='text'>
Following the example of ip4_datagram_connect, we store the
address in the socket structure for dgram/rdm sockets and use
that as the default destination for subsequent send() calls.
It is allowed to connect to any address types, and the behaviour
of send() will be the same as a normal sendto() with this address
provided. Binding to an AF_UNSPEC address clears the association.

Signed-off-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reviewed-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: remove redundant call to tipc_node_remove_conn</title>
<updated>2015-03-19T16:25:54Z</updated>
<author>
<name>Erik Hugne</name>
<email>erik.hugne@ericsson.com</email>
</author>
<published>2015-03-19T08:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18d6c58415fa9f5ec98767a2434acc8197c7f288'/>
<id>urn:sha1:18d6c58415fa9f5ec98767a2434acc8197c7f288</id>
<content type='text'>
tipc_node_remove_conn may be called twice if shutdown() is
called on a socket that have messages in the receive queue.
Calling this function twice does no harm, but is unnecessary
and we remove the redundant call.

Signed-off-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Acked-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: Use rhashtable max/min_size instead of max/min_shift</title>
<updated>2015-03-18T16:46:40Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2015-03-18T09:01:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=446c89ac1f6026df9e3e0ca2614b36909398d431'/>
<id>urn:sha1:446c89ac1f6026df9e3e0ca2614b36909398d431</id>
<content type='text'>
This patch converts tipc to use rhashtable max/min_size instead of
the obsolete max/min_shift.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix netns refcnt leak</title>
<updated>2015-03-18T02:11:26Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2015-03-18T01:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76100a8a64bc2ae898bc49d51dd28c1f4f5ed37b'/>
<id>urn:sha1:76100a8a64bc2ae898bc49d51dd28c1f4f5ed37b</id>
<content type='text'>
When the TIPC module is loaded, we launch a topology server in kernel
space, which in its turn is creating TIPC sockets for communication
with topology server users. Because both the socket's creator and
provider reside in the same module, it is necessary that the TIPC
module's reference count remains zero after the server is started and
the socket created; otherwise it becomes impossible to perform "rmmod"
even on an idle module.

Currently, we achieve this by defining a separate "tipc_proto_kern"
protocol struct, that is used only for kernel space socket allocations.
This structure has the "owner" field set to NULL, which restricts the
module reference count from being be bumped when sk_alloc() for local
sockets is called. Furthermore, we have defined three kernel-specific
functions, tipc_sock_create_local(), tipc_sock_release_local() and
tipc_sock_accept_local(), to avoid the module counter being modified
when module local sockets are created or deleted. This has worked well
until we introduced name space support.

However, after name space support was introduced, we have observed that
a reference count leak occurs, because the netns counter is not
decremented in tipc_sock_delete_local().

This commit remedies this problem. But instead of just modifying
tipc_sock_delete_local(), we eliminate the whole parallel socket
handling infrastructure, and start using the regular sk_create_kern(),
kernel_accept() and sk_release_kernel() calls. Since those functions
manipulate the module counter, we must now compensate for that by
explicitly decrementing the counter after module local sockets are
created, and increment it just before calling sk_release_kernel().

Fixes: a62fbccecd62 ("tipc: make subscriber server support net namespace")
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Reviewed-by: Jon Maloy &lt;jon.maloy@ericson.com&gt;
Reviewed-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Reported-by: Cong Wang &lt;cwang@twopensource.com&gt;
Tested-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
