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

Jakub Kicinski <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.