Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

um: drivers: call kernel_strrchr() explicitly in cow_user.c

Building ARCH=um on glibc >= 2.43 fails:

arch/um/drivers/cow_user.c: error: implicit declaration of
function 'strrchr' [-Wimplicit-function-declaration]

glibc 2.43's C23 const-preserving strrchr() macro does not survive
UML's global -Dstrrchr=kernel_strrchr remap from arch/um/Makefile.
Call kernel_strrchr() directly in cow_user.c so the source no longer
depends on the -D rewrite.

Fixes: 2c51a4bc0233 ("um: fix strrchr() problems")
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-6
Assisted-by: Codex:gpt-5-4
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Link: https://patch.msgid.link/20260408070102.2325572-1-michael.bommarito@gmail.com
[remove unnecessary 'extern']
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Michael Bommarito and committed by
Johannes Berg
91e901c6 8aae2da6

+7 -1
+7 -1
arch/um/drivers/cow_user.c
··· 15 15 #include "cow.h" 16 16 #include "cow_sys.h" 17 17 18 + /* 19 + * arch/um/Makefile remaps strrchr to kernel_strrchr; call the kernel 20 + * name directly to avoid glibc >= 2.43's C23 strrchr macro. 21 + */ 22 + char *kernel_strrchr(const char *, int); 23 + 18 24 #define PATH_LEN_V1 256 19 25 20 26 /* unsigned time_t works until year 2106 */ ··· 159 153 errno); 160 154 return -1; 161 155 } 162 - slash = strrchr(from, '/'); 156 + slash = kernel_strrchr(from, '/'); 163 157 if (slash != NULL) { 164 158 *slash = '\0'; 165 159 if (chdir(from)) {