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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240926154326.GF4029621@kernel.org>
Date: Thu, 26 Sep 2024 16:43:26 +0100
From: Simon Horman <horms@...nel.org>
To: Alexandre Ferrieux <alexandre.ferrieux@...il.com>
Cc: edumazet@...gle.com, alexandre.ferrieux@...nge.com,
	nicolas.dichtel@...nd.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv4: avoid quadratic behavior in FIB insertion
 of common address

On Thu, Sep 26, 2024 at 12:08:07PM +0200, Alexandre Ferrieux wrote:
> Mix netns into all IPv4 FIB hashes to avoid massive collision
> when inserting the same address in many netns.
> 
> Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@...nge.com>

Hi Alexandre,

Thanks for your updated patch.

net-next is currently closed for the v6.12 merge window. It should
reopen next week, after v6.12-rc1 has been released. Please repost
your patch, keeping in mind other feedback from Nicolas Dichtel after
it has reopned.

> ---
>  net/ipv4/fib_semantics.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index ba2df3d2ac15..e25c8bc56067 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -347,11 +347,9 @@ static unsigned int fib_info_hashfn_1(int init_val, u8 protocol, u8 scope,
>  	return val;
>  }
>  
> -static unsigned int fib_info_hashfn_result(unsigned int val)
> +static unsigned int fib_info_hashfn_result(const struct net *net, unsigned int val)

Please line wrap the above so it fits within 80 columns, as is still
preferred by Networking code.

checkpatch can be run with an option to flag this.

>  {
> -	unsigned int mask = (fib_info_hash_size - 1);
> -
> -	return (val ^ (val >> 7) ^ (val >> 12)) & mask;
> +	return hash_32(val ^ net_hash_mix(net), fib_info_hash_bits);
>  }
>  
>  static inline unsigned int fib_info_hashfn(struct fib_info *fi)

...

-- 
pw-bot: defer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ