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] [thread-next>] [day] [month] [year] [list]
Date: Wed, 31 May 2023 08:48:00 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: fuyuanli <fuyuanli@...iglobal.com>
Cc: "David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Neal Cardwell <ncardwell@...gle.com>, ycheng <ycheng@...gle.com>, toke <toke@...e.dk>, 
	netdev@...r.kernel.org, Weiping Zhang <zhangweiping@...iglobal.com>, 
	Tio Zhang <tiozhang@...iglobal.com>, Jason Xing <kerneljasonxing@...il.com>
Subject: Re: [PATCH net v3] tcp: fix mishandling when the sack compression is deferred

On Tue, May 30, 2023 at 6:03 PM fuyuanli <fuyuanli@...iglobal.com> wrote:
>
> In this patch, we mainly try to handle sending a compressed ack
> correctly if it's deferred.
>
> Here are more details in the old logic:
> When sack compression is triggered in the tcp_compressed_ack_kick(),
> if the sock is owned by user, it will set TCP_DELACK_TIMER_DEFERRED
> and then defer to the release cb phrase. Later once user releases
> the sock, tcp_delack_timer_handler() should send a ack as expected,
> which, however, cannot happen due to lack of ICSK_ACK_TIMER flag.
> Therefore, the receiver would not sent an ack until the sender's
> retransmission timeout. It definitely increases unnecessary latency.
>
> Fixes: 5d9f4262b7ea ("tcp: add SACK compression")
> Suggested-by: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: fuyuanli <fuyuanli@...iglobal.com>
> Signed-off-by: Jason Xing <kerneljasonxing@...il.com>
> Link: https://lore.kernel.org/netdev/20230529113804.GA20300@didi-ThinkCentre-M920t-N000/
> ---
> v3:
> 1) remove the flag which is newly added in v2 patch.
> 2) adjust the commit message.
>
> v2:
> 1) change the commit title and message
> 2) reuse the delayed ack logic when handling the sack compression
> as suggested by Eric.
> 3) "merge" another related patch into this one. See the second link.
> ---
>  include/net/tcp.h    |  1 +
>  net/ipv4/tcp_input.c |  2 +-
>  net/ipv4/tcp_timer.c | 16 +++++++++++++---
>  3 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 18a038d16434..6e1cd583a899 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -480,6 +480,7 @@ int tcp_disconnect(struct sock *sk, int flags);
>
>  void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
>  int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
> +void tcp_sack_compress_send_ack(struct sock *sk);
>  void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
>
>  /* From syncookies.c */


Minor nit, could you move this in the following section ?

/* tcp_input.c */
void tcp_rearm_rto(struct sock *sk);
void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req);
void tcp_reset(struct sock *sk, struct sk_buff *skb);
void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb);
void tcp_fin(struct sock *sk);
void tcp_check_space(struct sock *sk);

tcp_sack_compress_send_ack() is in fact in tcp_input.c

Then add

Reviewed-by: Eric Dumazet <edumazet@...gle.com>

Thanks !

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ