File 0001-cifs.upcall-correctly-treat-UPTARGET_UNSPECIFIED-as-.patch of Package cifs-utils.39288
From f4fd27cf60d6431d83ea18b4962aef845f9312bd Mon Sep 17 00:00:00 2001
From: Henrique Carvalho <henrique.carvalho@suse.com>
Date: Fri, 30 May 2025 12:28:14 -0300
Subject: [PATCH 1/3] cifs.upcall: correctly treat UPTARGET_UNSPECIFIED as
UPTARGET_APP
Kernels lacking commit db363b0a1d9e ("CIFS: New mount option for
cifs.upcall namespace resolution") omit the field upcall_target from the
key description sent to cifs.upcall, leaving args->upcall_target as
UPTARGET_UNSPECIFIED. That makes get_cachename_from_process_env() search
root's environment instead of the applications's environment (default
behavior), breaking some mounts.
Explicitly set arg->upcall_target to UPTARGET_APP.
Fixes: 89b679228cc1 ("CIFS.upcall to accommodate new namespace mount opt")
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
cifs.upcall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cifs.upcall.c b/cifs.upcall.c
index 2f7c478..69e27a3 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -1521,6 +1521,7 @@ int main(const int argc, char *const argv[])
*/
if (arg->upcall_target == UPTARGET_APP || arg->upcall_target == UPTARGET_UNSPECIFIED) {
syslog(LOG_INFO, "upcall_target=app, switching namespaces to application thread");
+ arg->upcall_target = UPTARGET_APP;
rc = switch_to_process_ns(arg->pid);
if (rc == -1) {
syslog(LOG_ERR, "unable to switch to process namespace: %s", strerror(errno));
--
2.47.0