string: Redefine strscpy_pad() as a macro
authorKees Cook <keescook@chromium.org>
Fri, 2 Feb 2024 11:18:14 +0000 (03:18 -0800)
committerKees Cook <keescook@chromium.org>
Wed, 21 Feb 2024 04:47:31 +0000 (20:47 -0800)
commitf478898e0aa74a759fcf629a3ee8b040467b8533
treea4ce041e524eb2eb11a998b3ba09eec0bf3ec69d
parent557f8c582a9ba8abe6aa0fd734b6f342af106b26
string: Redefine strscpy_pad() as a macro

In preparation for making strscpy_pad()'s 3rd argument optional, redefine
it as a macro. This also has the benefit of allowing greater FORITFY
introspection, as it couldn't see into the strscpy() nor the memset()
within strscpy_pad().

Cc: Andy Shevchenko <andy@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-hardening@vger.kernel.org>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
include/linux/string.h
lib/string_helpers.c