cifs: reinstate original behavior again for forceuid/forcegid
Subsystems (2)
PATCH 1/1 cifs: reinstate original behavior again for forceuid/forcegid
forceuid/forcegid should be enabled by default when uid=/gid= options are specified, but commit 24e0a1eff9e2 ("cifs: switch to new mount api") changed the behavior. This patch reinstates original behavior to overriding uid/gid with specified uid/gid.
--- fs/cifs/fs_context.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/fs_context.c +2 -0
@@ -972,6 +972,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_uid = uid; ctx->uid_specified = true; + ctx->override_uid =1 ;break ;case Opt_cruid: uid =make_kuid (current_user_ns (), result.uint_32);
@@ -1000,6 +1001,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_gid = gid; ctx->gid_specified = true; + ctx->override_gid =1 ;break ;case Opt_port: ctx->port = result.uint_32;
Signature · 1 line
2.40.0
Tom Talpey
reviewerQuoted 6 lines · Takayuki Nagata
forceuid/forcegid should be enabled by default when uid=/gid= options are specified, but commit
24e0a1eff9e2("cifs: switch to new mount api") changed the behavior. This patch reinstates original behavior to overriding uid/gid with specified uid/gid.Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")
This looks correct, but I'd love to hear Ronnie's call. Looking at that commit, was it simply an oversight to set override_{uid,gid}? It kind of looks that way, but...
Tom.
Quoted 25 lines
Signed-off-by Takayuki Nagata <[email protected]>--- fs/cifs/fs_context.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/fs_context.c +2
-0@@ -972,6 +972,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_uid = uid; ctx->uid_specified = true; + ctx->override_uid =1 ;break ;case Opt_cruid: uid =make_kuid (current_user_ns (), result.uint_32);@@ -1000,6 +1001,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_gid = gid; ctx->gid_specified = true; + ctx->override_gid =1 ;break ;case Opt_port: ctx->port = result.uint_32;
ronnie sahlberg
reviewerYeah, an oversight.
Acked-by me
Quoted 41 lines · Tom Talpey via samba-technical
Quoted 6 lines · Takayuki Nagata
forceuid/forcegid should be enabled by default when uid=/gid= options are specified, but commit
24e0a1eff9e2("cifs: switch to new mount api") changed the behavior. This patch reinstates original behavior to overriding uid/gid with specified uid/gid.Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")This looks correct, but I'd love to hear Ronnie's call. Looking at that commit, was it simply an oversight to set override_{uid,gid}? It kind of looks that way, but...
Tom.
Quoted 25 lines
Signed-off-by Takayuki Nagata <[email protected]>--- fs/cifs/fs_context.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/fs_context.c +2
-0@@ -972,6 +972,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_uid = uid; ctx->uid_specified = true; + ctx->override_uid =1 ;break ;case Opt_cruid: uid =make_kuid (current_user_ns (), result.uint_32);@@ -1000,6 +1001,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_gid = gid; ctx->gid_specified = true; + ctx->override_gid =1 ;break ;case Opt_port: ctx->port = result.uint_32;
Tentatively merged into cifs-2.6.git for-next
Any thoughts on priority sending it upstream soon?
Quoted 35 lines · Takayuki Nagata
forceuid/forcegid should be enabled by default when uid=/gid= options are specified, but commit
24e0a1eff9e2("cifs: switch to new mount api") changed the behavior. This patch reinstates original behavior to overriding uid/gid with specified uid/gid.Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")Signed-off-by Takayuki Nagata <[email protected]>--- fs/cifs/fs_context.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/fs_context.c +2
-1@@ -972,6 +972,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_uid = uid; ctx->uid_specified = true; + ctx->override_uid =1 ;break ;case Opt_cruid: uid =make_kuid (current_user_ns (), result.uint_32);@@ -1000,6 +1001,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_gid = gid; ctx->gid_specified = true; + ctx->override_gid =1 ;break ;case Opt_port: ctx->port = result.uint_32; --2.40.0
Signature · 3 lines
Thanks, Steve
Thank you for reviewing my patch.
I have no thoughts on the priority. So If it does not bother you to send the v2 patch, I will resend the v2 patch soon with a revised commit message to clarify "what breaks".
Takayuki Nagata
2023年4月7日(金) 13:13 Steve French <[email protected]>:
Quoted 48 lines
Tentatively merged into cifs-2.6.git for-next
Any thoughts on priority sending it upstream soon?
Quoted 33 lines · Takayuki Nagata
forceuid/forcegid should be enabled by default when uid=/gid= options are specified, but commit
24e0a1eff9e2("cifs: switch to new mount api") changed the behavior. This patch reinstates original behavior to overriding uid/gid with specified uid/gid.Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")Signed-off-by Takayuki Nagata <[email protected]>--- fs/cifs/fs_context.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/fs_context.c +2
-1@@ -972,6 +972,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_uid = uid; ctx->uid_specified = true; + ctx->override_uid =1 ;break ;case Opt_cruid: uid =make_kuid (current_user_ns (), result.uint_32);@@ -1000,6 +1001,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, goto cifs_parse_mount_err; ctx->linux_gid = gid; ctx->gid_specified = true; + ctx->override_gid =1 ;break ;case Opt_port: ctx->port = result.uint_32; --Quoted 2 lines
2.40.0
--
Thanks,Steve