<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sctp/output.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-10-26T21:32:19Z</updated>
<entry>
<title>sctp: fix the panic caused by route update</title>
<updated>2016-10-26T21:32:19Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-10-23T17:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ecc515d7238f2cffac839069d56dc271141defa0'/>
<id>urn:sha1:ecc515d7238f2cffac839069d56dc271141defa0</id>
<content type='text'>
Commit 7303a1475008 ("sctp: identify chunks that need to be fragmented
at IP level") made the chunk be fragmented at IP level in the next round
if it's size exceed PMTU.

But there still is another case, PMTU can be updated if transport's dst
expires and transport's pmtu_pending is set in sctp_packet_transmit. If
the new PMTU is less than the chunk, the same issue with that commit can
be triggered.

So we should drop this packet and let it retransmit in another round
where it would be fragmented at IP level.

This patch is to fix it by checking the chunk size after PMTU may be
updated and dropping this packet if it's size exceed PMTU.

Fixes: 90017accff61 ("sctp: Add GSO support")
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Neil Horman &lt;nhorman@txudriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: rename WORD_TRUNC/ROUND macros</title>
<updated>2016-09-22T07:13:26Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2016-09-21T11:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2f036a97271cf5811ee754bf321a29a814577f9'/>
<id>urn:sha1:e2f036a97271cf5811ee754bf321a29a814577f9</id>
<content type='text'>
To something more meaningful these days, specially because this is
working on packet headers or lengths and which are not tied to any CPU
arch but to the protocol itself.

So, WORD_TRUNC becomes SCTP_TRUNC4 and WORD_ROUND becomes SCTP_PAD4.

Reported-by: David Laight &lt;David.Laight@ACULAB.COM&gt;
Reported-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: not return ENOMEM err back in sctp_packet_transmit</title>
<updated>2016-09-19T02:02:33Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-09-13T18:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41001faf95faaff7c4f4f93c6bb544ee227ad0cc'/>
<id>urn:sha1:41001faf95faaff7c4f4f93c6bb544ee227ad0cc</id>
<content type='text'>
As David and Marcelo's suggestion, ENOMEM err shouldn't return back to
user in transmit path. Instead, sctp's retransmit would take care of
the chunks that fail to send because of ENOMEM.

This patch is only to do some release job when alloc_skb fails, not to
return ENOMEM back any more.

Besides, it also cleans up sctp_packet_transmit's err path, and fixes
some issues in err path:

 - It didn't free the head skb in nomem: path.
 - No need to check nskb in no_route: path.
 - It should goto err: path if alloc_skb fails for head.
 - Not all the NOMEMs should free nskb.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: save transmit error to sk_err in sctp_outq_flush</title>
<updated>2016-09-19T02:02:32Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-09-13T18:04:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=645194409b0634a43890ec27c491c368b3bffc07'/>
<id>urn:sha1:645194409b0634a43890ec27c491c368b3bffc07</id>
<content type='text'>
Every time when sctp calls sctp_outq_flush, it sends out the chunks of
control queue, retransmit queue and data queue. Even if some trunks are
failed to transmit, it still has to flush all the transports, as it's
the only chance to clean that transmit_list.

So the latest transmit error here should be returned back. This transmit
error is an internal error of sctp stack.

I checked all the places where it uses the transmit error (the return
value of sctp_outq_flush), most of them are actually just save it to
sk_err.

Except for sctp_assoc/endpoint_bh_rcv, they will drop the chunk if
it's failed to send a REPLY, which is actually incorrect, as we can't
be sure the error that sctp_outq_flush returns is from sending that
REPLY.

So it's meaningless for sctp_outq_flush to return error back.

This patch is to save transmit error to sk_err in sctp_outq_flush, the
new error can update the old value. Eventually, sctp_wait_for_* would
check for it.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: identify chunks that need to be fragmented at IP level</title>
<updated>2016-09-10T02:18:33Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2016-09-08T09:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7303a1475008bee5c3e82a06a282568415690d72'/>
<id>urn:sha1:7303a1475008bee5c3e82a06a282568415690d72</id>
<content type='text'>
Previously, without GSO, it was easy to identify it: if the chunk didn't
fit and there was no data chunk in the packet yet, we could fragment at
IP level. So if there was an auth chunk and we were bundling a big data
chunk, it would fragment regardless of the size of the auth chunk. This
also works for the context of PMTU reductions.

But with GSO, we cannot distinguish such PMTU events anymore, as the
packet is allowed to exceed PMTU.

So we need another check: to ensure that the chunk that we are adding,
actually fits the current PMTU. If it doesn't, trigger a flush and let
it be fragmented at IP level in the next round.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: fix the issue sctp requeue auth chunk incorrectly</title>
<updated>2016-07-31T05:06:22Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-07-30T05:58:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1aa25ec227a4be21515594f485b0f4985109f0d8'/>
<id>urn:sha1:1aa25ec227a4be21515594f485b0f4985109f0d8</id>
<content type='text'>
sctp needs to queue auth chunk back when we know that we are going
to generate another segment. But commit f1533cce60d1 ("sctp: fix
panic when sending auth chunks") requeues the last chunk processed
which is probably not the auth chunk.

It causes panic when calculating the MAC in sctp_auth_calculate_hmac(),
as the incorrect offset of the auth chunk in skb-&gt;data.

This fix is to requeue it by using packet-&gt;auth.

Fixes: f1533cce60d1 ("sctp: fix panic when sending auth chunks")
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: implement prsctp TTL policy</title>
<updated>2016-07-11T20:25:39Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-07-09T11:47:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6c2f792873aff332a4689717c3cd6104f46684c'/>
<id>urn:sha1:a6c2f792873aff332a4689717c3cd6104f46684c</id>
<content type='text'>
prsctp TTL policy is a policy to abandon chunks when they expire
at the specific time in local stack. It's similar with expires_at
in struct sctp_datamsg.

This patch uses sinfo-&gt;sinfo_timetolive to set the specific time for
TTL policy. sinfo-&gt;sinfo_timetolive is also used for msg-&gt;expires_at.
So if prsctp_enable or TTL policy is not enabled, msg-&gt;expires_at
still works as before.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: fix panic when sending auth chunks</title>
<updated>2016-07-09T04:08:21Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2016-07-07T12:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1533cce60d1f84378c1dd925f9ef1038fa93507'/>
<id>urn:sha1:f1533cce60d1f84378c1dd925f9ef1038fa93507</id>
<content type='text'>
When we introduced GSO support, if using auth the auth chunk was being
left queued on the packet even after the final segment was generated.
Later on sctp_transmit_packet it calls sctp_packet_reset, which zeroed
the packet len while not accounting for this left-over. This caused more
space to be used the next packet due to the chunk still being queued,
but space which wasn't allocated as its size wasn't accounted.

The fix is to only queue it back when we know that we are going to
generate another segment.

Fixes: 90017accff61 ("sctp: Add GSO support")
Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: Fix warning in sctp_packet_transmit_chunk()</title>
<updated>2016-06-04T05:53:26Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2016-06-04T05:53:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3b55a537d028ccc3e423e74a2037476318918341'/>
<id>urn:sha1:3b55a537d028ccc3e423e74a2037476318918341</id>
<content type='text'>
size_t objects should be printed with %Z printf format.

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: improve debug message to also log curr pkt and new chunk size</title>
<updated>2016-06-03T23:37:22Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2016-06-02T18:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=942b3235bf77e5600a05d6e85f0415bdeb8068bb'/>
<id>urn:sha1:942b3235bf77e5600a05d6e85f0415bdeb8068bb</id>
<content type='text'>
This is useful for debugging packet sizes.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Tested-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
