Re: [PATCH] binfmt: replace deprecated strncpy with strscpy_pad

From: Justin Stitt
Date: Thu Mar 21 2024 - 15:57:49 EST


Hi,

On Thu, Mar 21, 2024 at 9:23 AM Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>
> I am perplexed. Why not use get_task_comm fill_psinfo like binfmt_elf
> does?
>
> It seems very silly to copy half the function without locking and then
> not copy it's locking as well.
>
> Given that the more highly tested binfmt_elf uses get_task_comm I can't
> imagine a reason why binfmt_elf_fdpic can't use it as well.

I am not sure why the original opted for strncpy over get_task_comm
but I made the replacement without being aware of the literally
identical code present in binfmt_elf.c

I'll send a v2.

>
> Eric

Thanks
Justin