The following commit has been merged in the master branch:
commit 30b18c165752e6d0ce7b6daa6a90453f5e5e6d17
Author: Cheyenne Wills <[email protected]>
Date: Mon Mar 11 09:05:33 2024 -0600
Linux 6.8: Use roken's strlcpy() in kernel module
The Linux 6.8 commit 'string: Remove strlcpy()' (d26270061a) removed the
the strlcpy function from the Linux kernel. The replacement function,
strscpy(), cannot be used as a drop-in replacement as its currently a
Linux kernel specific function and there are differences in the returned
value.
We can use roken's strlcpy() (provided in roken/strlcpy.c).
Create a configure test to that defines its own strlcpy() to test
if the kernel doesn't provide one itself. Note, we need to use a
different function signature for strlcpy() from what the kernel might
have otherwise the test build succeeds when the kernel does provide a
strlcpy().
Update the OpenAFS kernel specific roken.h to define the prototype for
strlcpy when it's not present in the Linux kernel. We need to match the
defines used in the 'real' roken.h so the roken/strlcpy.c can build
properly. Add defines for ROKEN_LIB_FUNCTION, ROKEN_LIB_CALL and
ROKEN_LIB_VARIABLE to the kernel roken.h
Update Linux's osi_machdep.h to include roken.h so the strlcpy protoype
is available.
Update the Linux MakefileProto to include the strcpy-kernel object
when building the kernel module.
Change-Id: I64a5743ba94134538853f51cd6e7a8df19127624
Reviewed-on: https://gerrit.openafs.org/15646
Tested-by: BuildBot <[email protected]>
Reviewed-by: Benjamin Kaduk <[email protected]>
src/afs/LINUX/osi_machdep.h | 1 +
src/cf/linux-kernel-func.m4 | 11 +++++++++++
src/crypto/hcrypto/kernel/roken.h | 29 +++++++++++++++++++++++++++++
src/external/libafsdep | 1 +
src/libafs/MakefileProto.LINUX.in | 6 ++++--
5 files changed, 46 insertions(+), 2 deletions(-)
--
OpenAFS Master Repository
_______________________________________________
OpenAFS-cvs mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-cvs