<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/dccp/ccids/ccid3.c, branch linux-3.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-09-19T14:04:53Z</updated>
<entry>
<title>dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO)</title>
<updated>2012-09-19T14:04:53Z</updated>
<author>
<name>Mathias Krause</name>
</author>
<published>2012-08-15T11:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24635bcd494892f4fce7b2504f3f1c65cc2d6ad2'/>
<id>urn:sha1:24635bcd494892f4fce7b2504f3f1c65cc2d6ad2</id>
<content type='text'>
[ Upstream commit 7b07f8eb75aa3097cdfd4f6eac3da49db787381d ]

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;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>dccp: Return-value convention of hc_tx_send_packet()</title>
<updated>2010-10-28T17:27:00Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-10-27T19:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe84f4140f0d24deca8591e38926b95cfd097e62'/>
<id>urn:sha1:fe84f4140f0d24deca8591e38926b95cfd097e62</id>
<content type='text'>
This patch reorganises the return value convention of the CCID TX sending
function, to permit more flexible schemes, as required by subsequent patches.

Currently the convention is
 * values &lt; 0     mean error,
 * a value == 0   means "send now", and
 * a value x &gt; 0  means "send in x milliseconds".

The patch provides symbolic constants and a function to interpret return values.

In addition, it caps the maximum positive return value to 0xFFFF milliseconds,
corresponding to 65.535 seconds.  This is possible since in CCID-3/4 the
maximum possible inter-packet gap is fixed at t_mbi = 64 sec.

Signed-off-by: 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: remove unused argument in CCID tx function</title>
<updated>2010-10-12T04:57:41Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-10-11T18:37:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baf9e782e1dc4991edecfa3b8700cf8739c40259'/>
<id>urn:sha1:baf9e782e1dc4991edecfa3b8700cf8739c40259</id>
<content type='text'>
This removes the argument `more' from ccid_hc_tx_packet_sent, since it was
nowhere used in the entire code.

(Btw, this argument was not even used in the original KAME code where the
 function initially came from; compare the variable moreToSend in the
 freebsd61-dccp-kame-28.08.2006.patch kept by Emmanuel Lochin.)

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp ccid-3: Remove redundant 'options_received' struct</title>
<updated>2010-09-21T10:14:26Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-19T18:14:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=536bb20b45dee3f9b77b0d250f8ed0733a5cb025'/>
<id>urn:sha1:536bb20b45dee3f9b77b0d250f8ed0733a5cb025</id>
<content type='text'>
The `options_received' struct is redundant, since it re-duplicates the existing
`p' and `x_recv' fields. This patch removes the sub-struct and migrates the
format conversion operations to ccid3_hc_tx_parse_options().

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp tfrc/ccid-3: computing the loss rate from the Loss Event Rate</title>
<updated>2010-09-21T10:14:26Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-19T18:10:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=792e6d3389061ad449429b9ba228eb758c247ea0'/>
<id>urn:sha1:792e6d3389061ad449429b9ba228eb758c247ea0</id>
<content type='text'>
This adds a function to take care of the following, separate cases occurring in
the computation of the Loss Rate p:

 * 1/(2^32-1) is mapped into 0% as per RFC 4342, 8.5;
 * 1/0        is mapped into 100%, the maximum;
 * to avoid that p = 1/x is rounded down to 0 when x is very large, since this
   means accidentally re-entering slow-start indicated by p == 0, the minimum
   resolution value of p is now returned instead;
 * a bug in ccid3_hc_rx_getsockopt is fixed: 1/0 was mapped into ~0U.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp ccid-3: remove dead states</title>
<updated>2010-09-21T10:14:26Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-19T18:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80763dfbac4ed1e6dfe6ec08ef748e0e9aec3260'/>
<id>urn:sha1:80763dfbac4ed1e6dfe6ec08ef748e0e9aec3260</id>
<content type='text'>
This patch is thanks to an investigation by Leandro Sales de Melo and his
colleagues. They worked out two state diagrams which highlight the fact that
the xxx_TERM states in CCID-3/4 are in fact not necessary.

And this can be confirmed by in turn looking at the code: the xxx_TERM states
are only ever set in ccid3_hc_{rx,tx}_exit(): when CCID-3 sets the state
to xxx_TERM, it is at a time where no more processing should be going on,
hence it is not necessary to introduce a dedicated exit state - this is already
implied by unloading the CCID.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp: Add packet type information to CCID-specific option parsing</title>
<updated>2010-09-21T10:14:25Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-19T18:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4874c131d79695e3d372042781a408a1a8a762d8'/>
<id>urn:sha1:4874c131d79695e3d372042781a408a1a8a762d8</id>
<content type='text'>
This
 1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is
    necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
    which options may (not) appear on what packet type.

 2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
    RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
    and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").

 3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
    is also no longer necessary, since the CCID-specific option-parsing routines
    are passed every single parameter of the type-length-value option encoding.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp ccid-3: Simplify and consolidate tx_parse_options</title>
<updated>2010-09-15T10:36:02Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-14T18:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37efb03fbd0935f5f85a0538c46b53be5cf40504'/>
<id>urn:sha1:37efb03fbd0935f5f85a0538c46b53be5cf40504</id>
<content type='text'>
This simplifies and consolidates the TX option-parsing code:

 1. The Loss Intervals option is not currently used, so dead code related to
    this option is removed. I am aware of no plans to support the option, but
    if someone wants to implement it (e.g. for inter-op tests), it is better
    to start afresh than having to also update currently unused code.

 2. The Loss Event and Receive Rate options have a lot of code in common (both
    are 32 bit, both have same length etc.), so this is consolidated.

 3. The test against GSR is not necessary, because
    - on first loading CCID3, ccid_new() zeroes out all fields in the socket;
    - ccid3_hc_tx_packet_recv() treats 0 and ~0U equivalently, due to

	pinv = opt_recv-&gt;ccid3or_loss_event_rate;
	if (pinv == ~0U || pinv == 0)
		hctx-&gt;p = 0;

    - as a result, the sequence number field is removed from opt_recv.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp ccid-3: remove buggy RTT-sampling history lookup</title>
<updated>2010-09-15T10:36:02Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-14T18:18:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2c726309d88df3c5568486e4b5b9e4c3150903f'/>
<id>urn:sha1:d2c726309d88df3c5568486e4b5b9e4c3150903f</id>
<content type='text'>
This removes the RTT-sampling function tfrc_tx_hist_rtt(), since

 1. it suffered from complex passing of return values (the return value both
    indicated successful lookup while the value doubled as RTT sample);

 2. when for some odd reason the sample value equalled 0, this triggered a bug
    warning about "bogus Ack", due to the ambiguity of the return value;

 3. on a passive host which has not sent anything the TX history is empty and
    thus will lead to unwanted "bogus Ack" warnings such as
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-28197148
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-26641606.

The fix is to replace the implicit encoding by performing the steps manually.

Furthermore, the "bogus Ack" warning has been removed, since it can actually be
triggered due to several reasons (network reordering, old packet, (3) above),
hence it is not very useful.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
<entry>
<title>dccp ccid-3: A lower bound for the inter-packet scheduling algorithm</title>
<updated>2010-09-15T10:36:01Z</updated>
<author>
<name>Gerrit Renker</name>
</author>
<published>2010-09-14T18:16:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20cbd3e120a0c20bebe420e1fed0e816730bb988'/>
<id>urn:sha1:20cbd3e120a0c20bebe420e1fed0e816730bb988</id>
<content type='text'>
This fixes a subtle bug in the calculation of the inter-packet gap and shows
that t_delta, as it is currently used, is not needed.

The algorithm from RFC 5348, 8.3 below continually computes a send time t_nom,
which is initialised with the current time t_now; t_gran = 1E6 / HZ specifies
the scheduling granularity, s the packet size, and X the sending rate:

  t_distance = t_nom - t_now;		// in microseconds
  t_delta    = min(t_ipi, t_gran) / 2;	// `delta' parameter in microseconds

  if (t_distance &gt;= t_delta) {
	reschedule after (t_distance / 1000) milliseconds;
  } else {
  	t_ipi  = s / X;			// inter-packet interval in usec
	t_nom += t_ipi;			// compute the next send time
	send packet now;
  }

Problem:
--------
Rescheduling requires a conversion into milliseconds (sk_reset_timer()). The
highest jiffy resolution with HZ=1000 is 1 millisecond, so using a higher
granularity does not make much sense here.

As a consequence, values of t_distance &lt; 1000 are truncated to 0. This issue
has so far been resolved by using instead

  if (t_distance &gt;= t_delta + 1000)
	reschedule after (t_distance / 1000) milliseconds;

This is unnecessarily large, a lower bound is t_delta' = max(t_delta, 1000).
And it implies a further simplification:

 a) when HZ &gt;= 500, then t_delta &lt;= t_gran/2 = 10^6/(2*HZ) &lt;= 1000, so that
    t_delta' = MAX(1000, t_delta) = 1000 (constant value);

 b) when HZ &lt; 500, then t_delta = 1/2*MIN(rtt, t_ipi, t_gran) &lt;= t_gran/2,
    so that 1000 &lt;= t_delta' &lt;= t_gran/2.

The maximum error of using a constant t_delta in (b) is less than half a jiffy.

Fix:
----
The patch replaces t_delta with a constant, whose value depends on CONFIG_HZ,
changing the above algorithm to:

  if (t_distance &gt;= t_delta')
	reschedule after (t_distance / 1000) milliseconds;

where t_delta' = 10^6/(2*HZ) if HZ &lt; 500, and t_delta' = 1000 otherwise.

Signed-off-by: Gerrit Renker &lt;gerrit@erg.abdn.ac.uk&gt;
</content>
</entry>
</feed>
