From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Kees Cook" <kees@kernel.org>,
linux-kernel@vger.kernel.org,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Nir Lichtman" <nir@lichtman.org>,
syzbot+03e1af5c332f7e0eb84b@syzkaller.appspotmail.com,
"Tycho Andersen" <tandersen@netflix.com>,
"Vegard Nossum" <vegard.nossum@oracle.com>,
"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: Re: [GIT PULL] execve updates for v6.13-rc1
Date: Thu, 21 Nov 2024 02:41:12 +0000 [thread overview]
Message-ID: <20241121024112.GN3387508@ZenIV> (raw)
In-Reply-To: <20241121023619.GM3387508@ZenIV>
On Thu, Nov 21, 2024 at 02:36:19AM +0000, Al Viro wrote:
> On Wed, Nov 20, 2024 at 02:50:39PM -0800, Linus Torvalds wrote:
> > So you probably want to do something like
> >
> > const char *name = smp_load_acquire(&dentry->d_name.name);
> >
> > under the RCU read lock before then copying it with strscpy(). It
> > should always be NULL-terminated.
> >
> > If you want to be extra careful, you might surround it with a
> >
> > read_seqbegin_or_lock(&rename_lock, &seq);
>
> What for?
>
> char name[something];
>
> sprintf(name, "%*pD", sizeof(name) - 1, file);
>
> and be done with that...
... or
struct name_snapshot n;
take_dentry_name_snapshot(&n, file->f_path.dentry);
do_something(n.name.name);
release_dentry_name_snapshot(&n);
next prev parent reply other threads:[~2024-11-21 2:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 17:00 Kees Cook
2024-11-20 22:32 ` Linus Torvalds
2024-11-20 22:33 ` Linus Torvalds
2024-11-20 22:50 ` Linus Torvalds
2024-11-21 2:36 ` Al Viro
2024-11-21 2:41 ` Al Viro [this message]
2024-11-21 2:51 ` Linus Torvalds
2024-11-21 0:54 ` Eric W. Biederman
2024-11-21 2:23 ` Linus Torvalds
2024-11-21 2:29 ` Kees Cook
2024-11-21 2:45 ` Linus Torvalds
2024-11-21 17:22 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 17:28 ` Linus Torvalds
2024-11-21 17:47 ` Linus Torvalds
2024-11-21 18:00 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 18:02 ` Linus Torvalds
2024-11-21 18:47 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 18:50 ` Kees Cook
2024-11-21 19:23 ` Linus Torvalds
2024-11-21 21:31 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 21:48 ` Linus Torvalds
2024-11-21 22:24 ` Zbigniew Jędrzejewski-Szmek
2024-11-21 22:06 ` Kees Cook
2024-11-21 22:38 ` Linus Torvalds
[not found] ` <87zflrsw1c.fsf@email.froward.int.ebiederm.org>
2024-11-22 7:47 ` Zbigniew Jędrzejewski-Szmek
2024-11-22 10:21 ` Harald Arnesen
[not found] ` <87frnjqqh6.fsf@email.froward.int.ebiederm.org>
2024-11-24 15:21 ` Zbigniew Jędrzejewski-Szmek
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=20241121024112.GN3387508@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@linaro.org \
--cc=ebiederm@xmission.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nir@lichtman.org \
--cc=syzbot+03e1af5c332f7e0eb84b@syzkaller.appspotmail.com \
--cc=tandersen@netflix.com \
--cc=torvalds@linux-foundation.org \
--cc=vegard.nossum@oracle.com \
--cc=zbyszek@in.waw.pl \
/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®