Re: [PATCH] string: Check for "nonstring" attribute on strscpy() arguments

From: Kees Cook
Date: Thu Aug 22 2024 - 20:05:33 EST


On Mon, 05 Aug 2024 14:43:44 -0700, Kees Cook wrote:
> GCC already checks for arguments that are marked with the "nonstring"[1]
> attribute when used on standard C String API functions (e.g. strcpy). Gain
> this compile-time checking also for the kernel's primary string copying
> function, strscpy().
>
> Note that Clang has neither "nonstring" nor __builtin_has_attribute().
>
> [...]

Applied to for-next/hardening, thanks!

[1/1] string: Check for "nonstring" attribute on strscpy() arguments
https://git.kernel.org/kees/c/559048d156ff

Take care,

--
Kees Cook