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]
Message-Id: <614E2777-315B-4C47-94B8-F6E9D6F3E4B5@yandex-team.ru>
Date:   Mon, 17 Jan 2022 18:31:37 +0300
From:   Akhmat Karakotov <hmukos@...dex-team.ru>
To:     netdev@...r.kernel.org
Cc:     edumazet@...gle.com, Eric Dumazet <eric.dumazet@...il.com>,
        Alexander Azimov <mitradir@...dex-team.ru>,
        tom@...bertland.com, zeil@...dex-team.ru, davem@...emloft.net
Subject: Re: [RFC PATCH v3 net-next 4/4] tcp: change SYN ACK retransmit
 behaviour to account for rehash

Dear David, We got the patch reviewed couple of weeks ago, please let us know what further steps are required before merge. Thanks, Akhmat.

> On Dec 6, 2021, at 22:11, Akhmat Karakotov <hmukos@...dex-team.ru> wrote:
> 
> Disabling rehash behavior did not affect SYN ACK retransmits because hash
> was forcefully changed bypassing the sk_rethink_hash function. This patch
> adds a condition which checks for rehash mode before resetting hash.
> 
> Signed-off-by: Akhmat Karakotov <hmukos@...dex-team.ru>
> ---
> net/core/sock.c       | 3 ++-
> net/ipv4/tcp_output.c | 4 +++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/sock.c b/net/core/sock.c
> index daace0d10156..f2515f657974 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -1372,7 +1372,8 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
> ret = -EINVAL;
> break;
> }
> - sk->sk_txrehash = (u8)val;
> + /* Paired with READ_ONCE() in tcp_rtx_synack() */
> + WRITE_ONCE(sk->sk_txrehash, (u8)val);
> break;
> 
> default:
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 6d72f3ea48c4..bbb5f68b947a 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -4108,7 +4108,9 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
> struct flowi fl;
> int res;
> 
> - tcp_rsk(req)->txhash = net_tx_rndhash();
> + /* Paired with WRITE_ONCE() in sock_setsockopt() */
> + if (READ_ONCE(sk->sk_txrehash) == SOCK_TXREHASH_ENABLED)
> + tcp_rsk(req)->txhash = net_tx_rndhash();
> res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_NORMAL,
>  NULL);
> if (!res) {
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ