lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 04 Aug 2016 07:37:01 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Liang Ge <lungothrin@...il.com>
Cc:	edumazet@...gle.com, herbert@...dor.apana.org.au,
	高昌利 <xiaosuo@...il.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH] tcp-tso: fix faulty logic in tcp_tso_should_defer

On Thu, 2016-08-04 at 12:01 +0800, Liang Ge wrote:
> code does not match comment
> 
> 	head = tcp_write_queue_head(sk);
> 	skb_mstamp_get(&now);
> 	age = skb_mstamp_us_delta(&now, &head->skb_mstamp);
> 	/* If next ACK is likely to come too late (half srtt), do not defer */
> 	if (age < (tp->srtt_us >> 4))
> 		goto send_now;
> 
> This bug will cause TSO packets being transmitted too early, and force
> software to tear them apart.

What do you mean by 'tear them apart' ?

TSO auto defer is an optimization. No packet can be dropped because of
the choice made here.

> 
> When ack clocking is likely to broke, this check will try to push out
> some EXTRA probe the first chance possible. Some transmission has
> already happened due to Eric's work.

I can not parse the changelog really. 

> 
> This patch fix the check.
> ---
>  net/ipv4/tcp_output.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index b26aa87..7082964 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1833,7 +1833,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
>  	skb_mstamp_get(&now);
>  	age = skb_mstamp_us_delta(&now, &head->skb_mstamp);
>  	/* If next ACK is likely to come too late (half srtt), do not defer */
> -	if (age < (tp->srtt_us >> 4))
> +	if (age > (tp->srtt_us >> 4))
>  		goto send_now;
>  
>  	/* Ok, it looks like it is advisable to defer. */


I have no idea what precise problem you have with this code, but your
patch is breaking the logic.


This was properly explained in 50c8339e9299aaf09e48c8f94de39baec638c874
changelog :

    This patch implements an heuristic based on age of first
    skb in write queue : If it was sent very recently (less than half srtt),
    we can predict that no ACK packet will come in less than half rtt,
    so deferring might cause an under utilization of our window.
    




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ