[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ymv4ePDDh3Sgg5Ok@zx2c4.com>
Date: Fri, 29 Apr 2022 16:38:48 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Willy Tarreau <w@....eu>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Moshe Kol <moshe.kol@...l.huji.ac.il>,
Yossi Gilad <yossi.gilad@...l.huji.ac.il>,
Amit Klein <aksecurity@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net 1/7] secure_seq: use the 64 bits of the siphash
for port offset calculation
Hi Willy,
On Thu, Apr 28, 2022 at 02:39:55PM +0200, Willy Tarreau wrote:
> SipHash replaced MD5 in secure_ipv{4,6}_port_ephemeral() via commit
> 7cd23e5300c1 ("secure_seq: use SipHash in place of MD5"), but the output
> remained truncated to 32-bit only. In order to exploit more bits from the
> hash, let's make the functions return the full 64-bit of siphash_3u32().
> We also make sure the port offset calculation in __inet_hash_connect()
> remains done on 32-bit to avoid the need for div_u64_rem() and an extra
> cost on 32-bit systems.
>
> Cc: Jason A. Donenfeld <Jason@...c4.com>
> Cc: Moshe Kol <moshe.kol@...l.huji.ac.il>
> Cc: Yossi Gilad <yossi.gilad@...l.huji.ac.il>
> Cc: Amit Klein <aksecurity@...il.com>
> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: Willy Tarreau <w@....eu>
> ---
> include/net/inet_hashtables.h | 2 +-
> include/net/secure_seq.h | 4 ++--
> net/core/secure_seq.c | 4 ++--
> net/ipv4/inet_hashtables.c | 10 ++++++----
> net/ipv6/inet6_hashtables.c | 4 ++--
> 5 files changed, 13 insertions(+), 11 deletions(-)
For the secure_seq parts:
Acked-by: Jason A. Donenfeld <Jason@...c4.com> # For secure_seq.[ch]
Thanks,
Jason
Powered by blists - more mailing lists