[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <A627E42A-1F2C-4807-B2AD-089D94FCB210@linux.dev>
Date: Mon, 18 Aug 2025 13:02:59 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Doug Anderson <dianders@...omium.org>
Cc: Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <danielt@...nel.org>,
"Dr. David Alan Gilbert" <linux@...blig.org>,
Zhang Heng <zhangheng@...inos.cn>,
linux-hardening@...r.kernel.org,
kgdb-bugreport@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kdb: Replace deprecated strcpy() with strscpy()
Hi Doug,
On 19. Jul 2025, at 00:48, Doug Anderson wrote:
> On Fri, Jul 18, 2025 at 2:40 PM Thorsten Blum wrote:
>>
>> strcpy() is deprecated; use strscpy() instead.
>>
>> Link: https://github.com/KSPP/linux/issues/88
>> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
>> ---
>> kernel/debug/kdb/kdb_support.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> nit: Since this only covers things in the file `kdb_support.c` and not
> everything in kernel/debug/kdb, perhaps that should be in the subject
> line? Maybe "kdb: Replace deprecated strcpy() with strscpy() in
> kdb_strdup()"?
>
> Other than that, this looks fine to me.
>
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
I'm preparing a patch series for Daniel with my kdb changes.
For this one here, I initially used:
strscpy(s, str, n);
return s;
to replace 'return strcpy(s, str);', but now prefer:
memcpy(s, str, n);
return s;
because we already know the string length 'n'.
Can I keep your Reviewed-by: tag when making this change and submitting
it as part of a patch series?
Thanks,
Thorsten
Powered by blists - more mailing lists