Re: [PATCH net] net: pppoe: check register_netdevice_notifier() error in pppoe_init()

From: Jakub Kicinski

Date: Tue Aug 04 2026 - 21:53:06 EST


On Tue, 4 Aug 2026 22:20:53 +0800 Qingfang Deng wrote:
> >> +    err = register_netdevice_notifier(&pppoe_notifier);
> >> +    if (err)
> >> +        goto out_unregister_packs;
> >
> > You can move the registration above the dev_add_offload(), so that the
> > unwind path is cleaner.
> >
>
> AI-review found a use-after-free. To avoid that, this needs to be placed
> between register_pernet_device() and proto_register().

SG, but please note that register_netdevice_notifier()
cannot actually fail unless the notifier that's getting
registered fails.

Please do not add the Fixes tag, re-target this at net-next
and add something like:

This is a future looking check, register_netdevice_notifier()
only fails on double registration or if the registered notifier
itself returns an error.

to the commit msg