]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2026 13:55:56 +0000 (15:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2026 13:55:56 +0000 (15:55 +0200)
added patches:
um-drivers-call-kernel_strrchr-explicitly-in-cow_user.c.patch

queue-5.15/series
queue-5.15/um-drivers-call-kernel_strrchr-explicitly-in-cow_user.c.patch [new file with mode: 0644]

index a658dfef8fe6bc3571484389ef3ed13fede37716..05ddfc8455a1b341407f90df009ff7b9712b1217 100644 (file)
@@ -196,3 +196,4 @@ ocfs2-split-transactions-in-dio-completion-to-avoid-credit-exhaustion.patch
 padata-fix-pd-uaf-once-and-for-all.patch
 padata-remove-comment-for-reorder_work.patch
 driver-core-don-t-let-a-device-probe-until-it-s-read.patch
+um-drivers-call-kernel_strrchr-explicitly-in-cow_user.c.patch
diff --git a/queue-5.15/um-drivers-call-kernel_strrchr-explicitly-in-cow_user.c.patch b/queue-5.15/um-drivers-call-kernel_strrchr-explicitly-in-cow_user.c.patch
new file mode 100644 (file)
index 0000000..d64b730
--- /dev/null
@@ -0,0 +1,57 @@
+From 91e901c65b4da02a6fd543e3f0049829ae9645b7 Mon Sep 17 00:00:00 2001
+From: Michael Bommarito <michael.bommarito@gmail.com>
+Date: Wed, 8 Apr 2026 03:01:02 -0400
+Subject: um: drivers: call kernel_strrchr() explicitly in cow_user.c
+
+From: Michael Bommarito <michael.bommarito@gmail.com>
+
+commit 91e901c65b4da02a6fd543e3f0049829ae9645b7 upstream.
+
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/um/drivers/cow_user.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/arch/um/drivers/cow_user.c
++++ b/arch/um/drivers/cow_user.c
+@@ -15,6 +15,12 @@
+ #include "cow.h"
+ #include "cow_sys.h"
++/*
++ * arch/um/Makefile remaps strrchr to kernel_strrchr; call the kernel
++ * name directly to avoid glibc >= 2.43's C23 strrchr macro.
++ */
++char *kernel_strrchr(const char *, int);
++
+ #define PATH_LEN_V1 256
+ /* unsigned time_t works until year 2106 */
+@@ -153,7 +159,7 @@ static int absolutize(char *to, int size
+                          errno);
+               return -1;
+       }
+-      slash = strrchr(from, '/');
++      slash = kernel_strrchr(from, '/');
+       if (slash != NULL) {
+               *slash = '\0';
+               if (chdir(from)) {