Re: [PATCH net v2 2/3] ipv4: stop exception dump when nexthop group shrinks
From: Ido Schimmel
Date: Sun Oct 04 2026 - 04:02:53 EST
On Fri, Oct 02, 2026 at 01:50:59PM +0900, Daehyeon Ko wrote:
> Commit 4ce5dc9316de ("inet: switch inet_dump_fib() to RCU
> protection") allowed IPv4 FIB dumps to run concurrently with nexthop
> replacement.
>
> fib_dump_info_fnhe() uses fib_info_num_path() as the loop bound,
> then fib_info_nhc() independently reloads nh->nh_grp. If
> RTM_NEWNEXTHOP replaces a group with fewer paths between those loads,
> fib_info_nhc() returns NULL and the dump dereferences it through
> nhc_flags.
>
> Stop the walk when the indexed path is absent. Nexthop groups are
> dense, so the current snapshot has no later path.
>
> Fixes: 4ce5dc9316de ("inet: switch inet_dump_fib() to RCU protection")
> Reported-by: Ido Schimmel <idosch@xxxxxxxxxx>
> Link: https://lore.kernel.org/netdev/20261001170513.GA1657889@shredder/
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Daehyeon Ko <4ncienth@xxxxxxxxx>
Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>