From: Jakub Kicinski <kuba@kernel.org>
To: Qingfang Deng <qingfang.deng@linux.dev>
Cc: Minhong He <heminhong@kylinos.cn>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Kees Cook <kees@kernel.org>,
Eric Woudstra <ericwouds@gmail.com>, Felix Fietkau <nbd@nbd.name>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: pppoe: check register_netdevice_notifier() error in pppoe_init()
Date: Tue, 4 Aug 2026 18:52:41 -0700 [thread overview]
Message-ID: <20260804185241.605ec90c@kernel.org> (raw)
In-Reply-To: <fca5745a-dfa4-4e90-99fb-483536c94591@linux.dev>
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
prev parent reply other threads:[~2026-08-05 1:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 8:59 [PATCH net] net: pppoe: check register_netdevice_notifier() error in pppoe_init() Minhong He
2026-08-04 8:28 ` Qingfang Deng
2026-08-04 14:20 ` Qingfang Deng
2026-08-05 1:52 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804185241.605ec90c@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ericwouds@gmail.com \
--cc=heminhong@kylinos.cn \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=qingfang.deng@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox