From: Eric Dumazet <edumazet@google.com>
To: Binbin Deng <18983559317@163.com>
Cc: jk@codeconstruct.com.au, matt@codeconstruct.com.au,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Binbin Deng <dengbinbin21@nudt.edu.cn>
Subject: Re: [PATCH net v2] net/mctp: publish the mctp_dev only after it is initialised
Date: Tue, 22 Sep 2026 16:22:24 +0200 [thread overview]
Message-ID: <CANn89iJ45jSsXMShe+9gYVSMLwpC15nmBROFkdNWVVR-ZyE5YA@mail.gmail.com> (raw)
In-Reply-To: <729830b8.130.1a0c945579d.Coremail.18983559317@163.com>
On Tue, Sep 22, 2026 at 3:19 PM Binbin Deng <18983559317@163.com> wrote:
>
> From: Binbin Deng <18983559317@163.com>
>
> mctp_add_dev() links the new mctp_dev into dev->mctp_ptr before mdev->dev
> is assigned, so a reader that picks the device up in that window
> dereferences a net_device pointer that is still NULL:
>
>
> Fix by publishing only once the object is fully initialised:
> __mctp_dev_get() runs under rcu_read_lock() only and hands
> this object to readers as soon as mctp_ptr is assigned, so
> they must never observe mdev->dev == NULL.
>
> Fixes: 583be982d934 ("mctp: Add device handling and netlink interface")
> Signed-off-by: Binbin Deng <18983559317@163.com>
> ---
Reviewed-by: Eric Dumazet <edumazet@google.com>
Please next time wait ~24 hours before sending a new version.
Details in Documentation/process/maintainer-netdev.rst
next prev parent reply other threads:[~2026-09-22 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 13:19 Binbin Deng
2026-09-22 14:22 ` Eric Dumazet [this message]
2026-09-25 23:35 ` Jakub Kicinski
2026-09-25 23:40 ` patchwork-bot+netdevbpf
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=CANn89iJ45jSsXMShe+9gYVSMLwpC15nmBROFkdNWVVR-ZyE5YA@mail.gmail.com \
--to=edumazet@google.com \
--cc=18983559317@163.com \
--cc=davem@davemloft.net \
--cc=dengbinbin21@nudt.edu.cn \
--cc=horms@kernel.org \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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
all inboxes | Powered by JetHome®