Re: [PATCH] ipv4: only allow increasing fib_info_hash_size

From: David Ahern
Date: Wed Oct 13 2021 - 22:52:08 EST


On 10/13/21 2:05 AM, 张凯 wrote:
> Should we let the function still work when the below check is true, not goto failure?
>
> if (new_size < fib_info_hash_size)
> goto failure;
>
>

no, it can not.

if (fib_info_cnt >= fib_info_hash_size) {

means the hash table is full. It is going down this path to expand. If
expansion can not happen then you can not add more entries.

This is all theory hence the request for a simpler change; in reality
there should never be so many unique fib_info entries across namespaces
to hit an overflow.