From: Cengiz Can <cengiz.can@canonical.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: sloppy-logic-analyzer: fix use-after-free via debugfs trigger on unbind
Date: Tue, 28 Jul 2026 18:02:38 +0300 [thread overview]
Message-ID: <7f31351f-43ef-41f7-b30a-2a9a008d4f3d@canonical.com> (raw)
In-Reply-To: <amh6txid90mJjd62@shikoro>
On 7/28/26 12:47, Wolfram Sang wrote:
>
>> debugfs_create_file_unsafe("buf_size", 0600, priv->debug_dir, priv, &fops_buf_size);
>> debugfs_create_file_unsafe("capture", 0200, priv->debug_dir, priv, &fops_capture);
>> - debugfs_create_file_unsafe("trigger", 0200, priv->debug_dir, priv, &fops_trigger);
>> + debugfs_create_file("trigger", 0200, priv->debug_dir, priv, &fops_trigger);
>
> What about removing the other _unsafe calls as well? TBH, I can't recall
> why I used them. Doesn't make sense from today's perspective.
I checked those too, but buf_size and capture are fine as they are.
They use DEFINE_DEBUGFS_ATTRIBUTE(), whose read/write paths take a debugfs
reference (debugfs_file_get()/put()) around the access. So they already
hold a reference and removal waits for them.
Switching them to debugfs_create_file() would just add a second
get/put around the one they already do, so I would leave them.
Happy to send a follow-up if you'd prefer them consistent.
Thanks!
next prev parent reply other threads:[~2026-07-28 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 23:10 Cengiz Can
2026-07-28 9:47 ` Wolfram Sang
2026-07-28 15:02 ` Cengiz Can [this message]
2026-07-28 23:38 ` Wolfram Sang
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=7f31351f-43ef-41f7-b30a-2a9a008d4f3d@canonical.com \
--to=cengiz.can@canonical.com \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.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®