<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc/socket.c, branch v4.20</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.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-18T23:44:23Z</updated>
<entry>
<title>tipc: check group dests after tipc_wait_for_cond()</title>
<updated>2018-12-18T23:44:23Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-12-17T07:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3c6306d44082ef007a258ae1b86ea58e6974ee3f'/>
<id>urn:sha1:3c6306d44082ef007a258ae1b86ea58e6974ee3f</id>
<content type='text'>
Similar to commit 143ece654f9f ("tipc: check tsk-&gt;group in tipc_wait_for_cond()")
we have to reload grp-&gt;dests too after we re-take the sock lock.
This means we need to move the dsts check after tipc_wait_for_cond()
too.

Fixes: 75da2163dbb6 ("tipc: introduce communication groups")
Reported-and-tested-by: syzbot+99f20222fc5018d2b97a@syzkaller.appspotmail.com
Cc: Ying Xue &lt;ying.xue@windriver.com&gt;
Cc: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.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: check tsk-&gt;group in tipc_wait_for_cond()</title>
<updated>2018-12-14T23:48:49Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-12-12T05:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=143ece654f9f5b37bedea252a990be37e48ae3a5'/>
<id>urn:sha1:143ece654f9f5b37bedea252a990be37e48ae3a5</id>
<content type='text'>
tipc_wait_for_cond() drops socket lock before going to sleep,
but tsk-&gt;group could be freed right after that release_sock().
So we have to re-check and reload tsk-&gt;group after it wakes up.

After this patch, tipc_wait_for_cond() returns -ERESTARTSYS when
tsk-&gt;group is NULL, instead of continuing with the assumption of
a non-NULL tsk-&gt;group.

(It looks like 'dsts' should be re-checked and reloaded too, but
it is a different bug.)

Similar for tipc_send_group_unicast() and tipc_send_group_anycast().

Reported-by: syzbot+10a9db47c3a0e13eb31c@syzkaller.appspotmail.com
Fixes: b7d42635517f ("tipc: introduce flow control for group broadcast messages")
Fixes: ee106d7f942d ("tipc: introduce group anycast messaging")
Fixes: 27bd9ec027f3 ("tipc: introduce group unicast messaging")
Cc: Ying Xue &lt;ying.xue@windriver.com&gt;
Cc: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.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 lock_sock() in tipc_sk_reinit()</title>
<updated>2018-12-14T21:16:33Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-12-10T19:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=15ef70e286176165d28b0b8a969b422561a68dfc'/>
<id>urn:sha1:15ef70e286176165d28b0b8a969b422561a68dfc</id>
<content type='text'>
lock_sock() must be used in process context to be race-free with
other lock_sock() callers, for example, tipc_release(). Otherwise
using the spinlock directly can't serialize a parallel tipc_release().

As it is blocking, we have to hold the sock refcnt before
rhashtable_walk_stop() and release it after rhashtable_walk_start().

Fixes: 07f6c4bc048a ("tipc: convert tipc reference table to use generic rhashtable")
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Ying Xue &lt;ying.xue@windriver.com&gt;
Cc: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: don't assume linear buffer when reading ancillary data</title>
<updated>2018-11-18T06:08:02Z</updated>
<author>
<name>Jon Maloy</name>
<email>donmalo99@gmail.com</email>
</author>
<published>2018-11-17T17:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c1274a56999fbdf9cf84e332b28448bb2d55221'/>
<id>urn:sha1:1c1274a56999fbdf9cf84e332b28448bb2d55221</id>
<content type='text'>
The code for reading ancillary data from a received buffer is assuming
the buffer is linear. To make this assumption true we have to linearize
the buffer before message data is read.

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>Revert "net: simplify sock_poll_wait"</title>
<updated>2018-10-23T17:57:06Z</updated>
<author>
<name>Karsten Graul</name>
<email>kgraul@linux.ibm.com</email>
</author>
<published>2018-10-23T11:40:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=89ab066d4229acd32e323f1569833302544a4186'/>
<id>urn:sha1:89ab066d4229acd32e323f1569833302544a4186</id>
<content type='text'>
This reverts commit dd979b4df817e9976f18fb6f9d134d6bc4a3c317.

This broke tcp_poll for SMC fallback: An AF_SMC socket establishes an
internal TCP socket for the initial handshake with the remote peer.
Whenever the SMC connection can not be established this TCP socket is
used as a fallback. All socket operations on the SMC socket are then
forwarded to the TCP socket. In case of poll, the file-&gt;private_data
pointer references the SMC socket because the TCP socket has no file
assigned. This causes tcp_poll to wait on the wrong socket.

Signed-off-by: Karsten Graul &lt;kgraul@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2018-10-13T04:38:46Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2018-10-13T04:38:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d864991b220b7c62e81d21209e1fd978fd67352c'/>
<id>urn:sha1:d864991b220b7c62e81d21209e1fd978fd67352c</id>
<content type='text'>
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: queue socket protocol error messages into socket receive buffer</title>
<updated>2018-10-11T05:56:07Z</updated>
<author>
<name>Parthasarathy Bhuvaragan</name>
<email>parthasarathy.bhuvaragan@ericsson.com</email>
</author>
<published>2018-10-10T15:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7eb05823806502747eadc31039cecfd7836ddeb'/>
<id>urn:sha1:e7eb05823806502747eadc31039cecfd7836ddeb</id>
<content type='text'>
In tipc_sk_filter_rcv(), when we detect protocol messages with error we
call tipc_sk_conn_proto_rcv() and let it reset the connection and notify
the socket by calling sk-&gt;sk_state_change().

However, tipc_sk_filter_rcv() may have been called from the function
tipc_backlog_rcv(), in which case the socket lock is held and the socket
already awake. This means that the sk_state_change() call is ignored and
the error notification lost. Now the receive queue will remain empty and
the socket sleeps forever.

In this commit, we convert the protocol message into a connection abort
message and enqueue it into the socket's receive queue. By this addition
to the above state change we cover all conditions.

Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Parthasarathy Bhuvaragan &lt;parthasarathy.bhuvaragan@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>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2018-10-04T04:00:17Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2018-10-04T04:00:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f41617bf23a17d9cb7cc6ca8161534f05f80293'/>
<id>urn:sha1:6f41617bf23a17d9cb7cc6ca8161534f05f80293</id>
<content type='text'>
Minor conflict in net/core/rtnetlink.c, David Ahern's bug fix in 'net'
overlapped the renaming of a netlink attribute in net-next.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: buffer overflow handling in listener socket</title>
<updated>2018-09-29T18:24:22Z</updated>
<author>
<name>Tung Nguyen</name>
<email>tung.q.nguyen@dektech.com.au</email>
</author>
<published>2018-09-28T18:23:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6787927475e52f6933e3affce365dabb2aa2fadf'/>
<id>urn:sha1:6787927475e52f6933e3affce365dabb2aa2fadf</id>
<content type='text'>
Default socket receive buffer size for a listener socket is 2Mb. For
each arriving empty SYN, the linux kernel allocates a 768 bytes buffer.
This means that a listener socket can serve maximum 2700 simultaneous
empty connection setup requests before it hits a receive buffer
overflow, and much fewer if the SYN is carrying any significant
amount of data.

When this happens the setup request is rejected, and the client
receives an ECONNREFUSED error.

This commit mitigates this problem by letting the client socket try to
retransmit the SYN message multiple times when it sees it rejected with
the code TIPC_ERR_OVERLOAD. Retransmission is done at random intervals
in the range of [100 ms, setup_timeout / 4], as many times as there is
room for within the setup timeout limit.

Signed-off-by: Tung Nguyen &lt;tung.q.nguyen@dektech.com.au&gt;
Acked-by: Ying Xue &lt;ying.xue@windriver.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>tipc: add SYN bit to connection setup messages</title>
<updated>2018-09-29T18:24:22Z</updated>
<author>
<name>Jon Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2018-09-28T18:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25b9221b959483f17c2964d0922869e16caa86b5'/>
<id>urn:sha1:25b9221b959483f17c2964d0922869e16caa86b5</id>
<content type='text'>
Messages intended for intitating a connection are currently
indistinguishable from regular datagram messages. The TIPC
protocol specification defines bit 17 in word 0 as a SYN bit
to allow sanity check of such messages in the listening socket,
but this has so far never been implemented.

We do that in this commit.

Acked-by: Ying Xue &lt;ying.xue@windriver.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>
</feed>
