[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2266f05b-57ae-435b-ae4b-f7ff035e6ce4@kernel.org>
Date: Tue, 8 Oct 2024 08:40:21 -0600
From: David Ahern <dsahern@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Kuniyuki Iwashima <kuniyu@...zon.com>, netdev@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH net-next] ipv6: switch inet6_addr_hash() to less
predictable hash
On 10/8/24 6:01 AM, Eric Dumazet wrote:
> In commit 3f27fb23219e ("ipv6: addrconf: add per netns perturbation
> in inet6_addr_hash()"), I added net_hash_mix() in inet6_addr_hash()
> to get better hash dispersion, at a time all netns were sharing the
> hash table.
>
> Since then, commit 21a216a8fc63 ("ipv6/addrconf: allocate a per
> netns hash table") made the hash table per netns.
>
> We could remove the net_hash_mix() from inet6_addr_hash(), but
> there is still an issue with ipv6_addr_hash().
>
> It is highly predictable and a malicious user can easily create
> thousands of IPv6 addresses all stored in the same hash bucket.
>
> Switch to __ipv6_addr_jhash(). We could use a dedicated
> secret, or reuse net_hash_mix() as I did in this patch.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> net/ipv6/addrconf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: David Ahern <dsahern@...nel.org>
Powered by blists - more mailing lists