* [RFC] Precarious macro in tools/include/linux/string.h
@ 2026-05-05 4:21 Maxwell Doose
2026-05-06 3:37 ` Wei Yang
0 siblings, 1 reply; 2+ messages in thread
From: Maxwell Doose @ 2026-05-05 4:21 UTC (permalink / raw)
To: rppt, richard.weiyang; +Cc: linux-gpio, open list, linux-mm, Lucas Poupeau
Hello Wei and Mike,
I was recently helping a new contributor with their patch replacing
strcpy() with strscpy() in tools/gpio. After some research I put a
hold on that and realized that strscpy was defined as strcpy, which is
extremely precarious and goes against the ideas the kernel has been
fighting for for years, and I traced that change back to commit
9e3d665 authored by Wei and merged by Mike. I'm currently working with
said contributor to get this alias removed and the proper function
definition added, just wanted to give you a heads up.
Are there any tools or dependencies that rely on strscpy() being
aliased to strcpy() before we replace it with the real definition?
best regards,
max
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] Precarious macro in tools/include/linux/string.h
2026-05-05 4:21 [RFC] Precarious macro in tools/include/linux/string.h Maxwell Doose
@ 2026-05-06 3:37 ` Wei Yang
0 siblings, 0 replies; 2+ messages in thread
From: Wei Yang @ 2026-05-06 3:37 UTC (permalink / raw)
To: Maxwell Doose
Cc: rppt, richard.weiyang, linux-gpio, open list, linux-mm,
Lucas Poupeau
On Mon, May 04, 2026 at 11:21:35PM -0500, Maxwell Doose wrote:
>Hello Wei and Mike,
>
>I was recently helping a new contributor with their patch replacing
>strcpy() with strscpy() in tools/gpio. After some research I put a
>hold on that and realized that strscpy was defined as strcpy, which is
>extremely precarious and goes against the ideas the kernel has been
>fighting for for years, and I traced that change back to commit
>9e3d665 authored by Wei and merged by Mike. I'm currently working with
>said contributor to get this alias removed and the proper function
>definition added, just wanted to give you a heads up.
Thanks for the effort.
>
>Are there any tools or dependencies that rely on strscpy() being
>aliased to strcpy() before we replace it with the real definition?
>
The alias is introduced to fix the test case in tools/testing/memblock, since
reserved_mem_add() use strscpy() but there is no definition in tools/.
So replace the alias with proper function definition looks good to me.
>best regards,
>max
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-06 3:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 4:21 [RFC] Precarious macro in tools/include/linux/string.h Maxwell Doose
2026-05-06 3:37 ` Wei Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox