aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/code-patching.c
diff options
context:
space:
mode:
authorJustin Stitt <[email protected]>2024-04-12 18:53:47 +0000
committerLuis Chamberlain <[email protected]>2024-05-14 07:31:43 +0000
commit086437d94aa3591b459e64bffed657b88dcc46a7 (patch)
treee5398efdec39b67952d239352ea1cccc95accbb9 /arch/powerpc/lib/code-patching.c
parentmodule: allow UNUSED_KSYMS_WHITELIST to be relative against objtree. (diff)
downloadkernel-086437d94aa3591b459e64bffed657b88dcc46a7.tar.gz
kernel-086437d94aa3591b459e64bffed657b88dcc46a7.zip
kallsyms: replace deprecated strncpy with strscpy
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. The goal is to remove its use completely [2]. namebuf is eventually cleaned of any trailing llvm suffixes using strstr(). This hints that namebuf should be NUL-terminated. static void cleanup_symbol_name(char *s) { char *res; ... res = strstr(s, ".llvm."); ... } Due to this, use strscpy() over strncpy() as it guarantees NUL-termination on the destination buffer. Drop the -1 from the length calculation as it is no longer needed to ensure NUL-termination. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html Link: https://github.com/KSPP/linux/issues/90 [2] Cc: [email protected] Signed-off-by: Justin Stitt <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
0 files changed, 0 insertions, 0 deletions