Re: [GIT PULL] execve updates for v6.13-rc1
From: Al Viro
Date: Wed Nov 20 2024 - 21:36:36 EST
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...