From: "Danilo Krummrich" <dakr@kernel.org>
To: "Linkai Gong" <gonglinkai@kylinos.cn>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Keith Busch" <kbusch@kernel.org>, <driver-core@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/base/node: fix UAF on device_register() failure
Date: Thu, 06 Aug 2026 23:53:39 +0200 [thread overview]
Message-ID: <DKI70XPQTCBY.1MSQGUFCEV2WT@kernel.org> (raw)
In-Reply-To: <20260806082804.2845360-1-gonglinkai@kylinos.cn>
On Thu Aug 6, 2026 at 10:28 AM CEST, Linkai Gong wrote:
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 3da91929ad4e..d2fd57c2edc8 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -176,8 +176,10 @@ static struct node_access_nodes *node_init_node_access(struct node *node,
> pm_runtime_no_callbacks(dev);
> list_add_tail(&access_node->list_node, &node->access_list);
> return access_node;
> +
> free_name:
> - kfree_const(dev->kobj.name);
> + put_device(dev);
> + return NULL;
Good catch, but we should also rename the label; free_name is misleading.
prev parent reply other threads:[~2026-08-06 21:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 8:28 [PATCH] drivers/base/node: fix UAF on device_register() failure Linkai Gong
2026-08-06 21:53 ` Danilo Krummrich [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=DKI70XPQTCBY.1MSQGUFCEV2WT@kernel.org \
--to=dakr@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=driver-core@lists.linux.dev \
--cc=gonglinkai@kylinos.cn \
--cc=gregkh@linuxfoundation.org \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/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