[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wj6kh-N4n1zZEzJx+eCO_Wf2JGOGqb_Ndi6oo2QiEMmCQ@mail.gmail.com>
Date: Wed, 20 Nov 2024 18:51:12 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Kees Cook <kees@...nel.org>, linux-kernel@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>, Dan Carpenter <dan.carpenter@...aro.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>, Nir Lichtman <nir@...htman.org>,
syzbot+03e1af5c332f7e0eb84b@...kaller.appspotmail.com,
Tycho Andersen <tandersen@...flix.com>, Vegard Nossum <vegard.nossum@...cle.com>,
Zbigniew Jędrzejewski-Szmek <zbyszek@...waw.pl>
Subject: Re: [GIT PULL] execve updates for v6.13-rc1
On Wed, 20 Nov 2024 at 18:36, Al Viro <viro@...iv.linux.org.uk> wrote:
> > If you want to be extra careful, you might surround it with a
> >
> > read_seqbegin_or_lock(&rename_lock, &seq);
>
> What for?
Yeah, probably no good reason.
> char name[something];
>
> sprintf(name, "%*pD", sizeof(name) - 1, file);
>
> and be done with that...
I think you might as well just do the much cheaper
rcu_read_lock();
strscpy_pad(tsk->comm, sizeof(tsk->comm),
smp_read_acquire(&dentry->d_name.name);
rcu_read_unlock();
and be done with it. Using snprintf() on tsk->comm[] violates all the
rules we have for it, and while our rules aren't great, *that* one we
shouldn't do.
Linus
Powered by blists - more mailing lists