OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_11-28-g7b4802e
Gerrit Code Review
gerrit@openafs.org
Thu, 16 May 2024 12:31:29 -0400
The following commit has been merged in the openafs-stable-1_8_x branch:
commit 7b4802efaf29ef76969c8b931a31e93dd4fbb000
Author: Cheyenne Wills <cwills@sinenomine.net>
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.
Reviewed-on: https://gerrit.openafs.org/15646
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 30b18c165752e6d0ce7b6daa6a90453f5e5e6d17)
Change-Id: I8013623e8f735d15bb7d4ac84ed0867f12b77783
Reviewed-on: https://gerrit.openafs.org/15706
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
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