summaryrefslogtreecommitdiffstats
path: root/fs/smb/client/fs_context.h
diff options
context:
space:
mode:
authorRitvik Budhiraja <rbudhiraja@microsoft.com>2024-11-11 12:43:51 +0100
committerSteve French <stfrench@microsoft.com>2024-11-21 17:44:03 +0100
commitdb363b0a1d9e6b9dc556296f1b1007aeb496a8cf (patch)
tree6b5079359537034d238d9520c1ab187f01fe743f /fs/smb/client/fs_context.h
parentsmb/client: Prevent error pointer dereference (diff)
downloadlinux-db363b0a1d9e6b9dc556296f1b1007aeb496a8cf.tar.xz
linux-db363b0a1d9e6b9dc556296f1b1007aeb496a8cf.zip
CIFS: New mount option for cifs.upcall namespace resolution
In the current implementation, the SMB filesystem on a mount point can trigger upcalls from the kernel to the userspace to enable certain functionalities like spnego, dns_resolution, amongst others. These upcalls usually either happen in the context of the mount or in the context of an application/user. The upcall handler for cifs, cifs.upcall already has existing code which switches the namespaces to the caller's namespace before handling the upcall. This behaviour is expected for scenarios like multiuser mounts, but might not cover all single user scenario with services such as Kubernetes, where the mount can happen from different locations such as on the host, from an app container, or a driver pod which does the mount on behalf of a different pod. This patch introduces a new mount option called upcall_target, to customise the upcall behaviour. upcall_target can take 'mount' and 'app' as possible values. This aids use cases like Kubernetes where the mount happens on behalf of the application in another container altogether. Having this new mount option allows the mount command to specify where the upcall should happen: 'mount' for resolving the upcall to the host namespace, and 'app' for resolving the upcall to the ns of the calling thread. This will enable both the scenarios where the Kerberos credentials can be found on the application namespace or the host namespace to which just the mount operation is "delegated". Reviewed-by: Shyam Prasad <shyam.prasad@microsoft.com> Reviewed-by: Bharath S M <bharathsm@microsoft.com> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Ritvik Budhiraja <rbudhiraja@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r--fs/smb/client/fs_context.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h
index 890d6d9d4a59..67b7fc48ac58 100644
--- a/fs/smb/client/fs_context.h
+++ b/fs/smb/client/fs_context.h
@@ -61,6 +61,12 @@ enum cifs_sec_param {
Opt_sec_err
};
+enum cifs_upcall_target_param {
+ Opt_upcall_target_mount,
+ Opt_upcall_target_application,
+ Opt_upcall_target_err
+};
+
enum cifs_param {
/* Mount options that take no arguments */
Opt_user_xattr,
@@ -114,6 +120,8 @@ enum cifs_param {
Opt_multichannel,
Opt_compress,
Opt_witness,
+ Opt_is_upcall_target_mount,
+ Opt_is_upcall_target_application,
/* Mount options which take numeric value */
Opt_backupuid,
@@ -157,6 +165,7 @@ enum cifs_param {
Opt_sec,
Opt_cache,
Opt_reparse,
+ Opt_upcalltarget,
/* Mount options to be ignored */
Opt_ignore,
@@ -198,6 +207,7 @@ struct smb3_fs_context {
umode_t file_mode;
umode_t dir_mode;
enum securityEnum sectype; /* sectype requested via mnt opts */
+ enum upcall_target_enum upcall_target; /* where to upcall for mount */
bool sign; /* was signing requested via mnt opts? */
bool ignore_signature:1;
bool retry:1;