From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C5E23A63EC; Mon, 4 May 2026 13:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777902935; cv=none; b=jNPnvqW8JXJIW58U7rBXn1BtdPQUzlz9rxQqQt8a+BILiPx9kfRepWoaqqmewmB3kXm15ekYvMkC1aORrIyIA69Kt2aFLMbSHYqMTsctgTq2V6PjmJ/dkLER0muqCZ6XGDPRiACr6Qbe/0URI626Swg0auOjYG6CiCzfaEk9mfI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777902935; c=relaxed/simple; bh=BfQMA1A2rPjoElYoEkR6wRISl1dgdAwLDQBnAoIpyqI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tjbNkL9Sb8/sx0z49MDQGuL5DSFmb5rEqfQ6mD+cJE3gtOlV+nTizilIysaMF5oJuptR9SocEgTV9ilkP60rOnRX5K3i1qWXMvLyMJB12tlsu1e2Fpe2FfL5ra02KCWxOc1FBdBndfGWPwy/b0tWE3W12s8MPLBlxRLSWgFdo3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XuHv7LCu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XuHv7LCu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E739AC2BCB8; Mon, 4 May 2026 13:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777902935; bh=BfQMA1A2rPjoElYoEkR6wRISl1dgdAwLDQBnAoIpyqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XuHv7LCuXnIZ/pB0LOsTDFP2PjWvVoaRZYBCwUp/u/6ug6HURpsuSOGKkTe+GHjrL TsqUpzyTgZAiPUembQ1YnTPFTjR/1pnpXsK1m4j4/P3k8lBei2Tk2wpROMjbsTwyMK mSie5ESsYtImPmZO9cobWcoT9LF3Zu9RDkpAzWgk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Johannes Berg , Michael Bommarito , Johannes Berg Subject: [PATCH 7.0 040/307] um: drivers: call kernel_strrchr() explicitly in cow_user.c Date: Mon, 4 May 2026 15:48:45 +0200 Message-ID: <20260504135144.328571787@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135142.814938198@linuxfoundation.org> References: <20260504135142.814938198@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Bommarito 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 Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-6 Assisted-by: Codex:gpt-5-4 Signed-off-by: Michael Bommarito Link: https://patch.msgid.link/20260408070102.2325572-1-michael.bommarito@gmail.com [remove unnecessary 'extern'] Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- 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)) {