Re: [PATCH v3] ipv6: route: Unregister netdevice notifier on BPF init failure

From: Ido Schimmel

Date: Wed May 20 2026 - 03:43:41 EST


Subject prefix should be [PATCH net v3]. See:

https://docs.kernel.org/process/maintainer-netdev.html

On Tue, May 19, 2026 at 11:03:28PM -0400, Yuho Choi wrote:
> ip6_route_init() registers ip6_route_dev_notifier before registering the
> IPv6 route BPF iterator target. If bpf_iter_register() fails after the
> notifier has been registered, the error path currently jumps to
> out_register_late_subsys and unwinds the RTNL handlers and pernet route
> state without removing the notifier from the netdevice notifier chain.
>
> This leaves ip6_route_dev_notify() callable after the IPv6 route state it
> uses has been torn down. Add a separate unwind label for the BPF iterator
> failure path and unregister the netdevice notifier before continuing with
> the existing cleanup.
>
> Fixes: 138d0be35b14 ("net: bpf: Add netlink and ipv6_route bpf_iter targets")
> Signed-off-by: Yuho Choi <dbgh9129@xxxxxxxxx>

Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>