Skip to contentSkip to conversation

cifs: Do not use the original cruid when following DFS links for multiuser mounts

PATCH In review Ronnie Sahlberg 3 participants 3 messages Jul 13, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: Do not use the original cruid when following DFS links for multiuser mounts

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213565

cruid should only be used for the initial mount and after this we should use the current users credentials.
Ignore the original cruid mount argument when creating a new context for a multiuser mount following a DFS link.

Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")
---
 fs/cifs/cifs_dfs_ref.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/cifs/cifs_dfs_ref.c +4 -0
index ec57cdb1590f..5c9a8778c99d 100644
@@ -208,6 +208,10 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
 		else
 			noff = tkn_e - (sb_mountdata + off) + 1;
 
+		if (strncasecmp(sb_mountdata + off, "cruid=", 6) == 0) {
+			off += noff;
+			continue;
+		}
 		if (strncasecmp(sb_mountdata + off, "unc=", 4) == 0) {
 			off += noff;
 			continue;
Signature · 1 line
2.30.2
#1 lore raw

tentatively merged into cifs-2.6.git for-next pending testing

Quoted 33 lines · Ronnie Sahlberg

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213565

cruid should only be used for the initial mount and after this we should use the current users credentials.
Ignore the original cruid mount argument when creating a new context for a multiuser mount following a DFS link.

Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")
---
 fs/cifs/cifs_dfs_ref.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/cifs/cifs_dfs_ref.c +4 -1
index ec57cdb1590f..5c9a8778c99d 100644
@@ -208,6 +208,10 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
                else
                        noff = tkn_e - (sb_mountdata + off) + 1;
 
+               if (strncasecmp(sb_mountdata + off, "cruid=", 6) == 0) {
+                       off += noff;
+                       continue;
+               }
                if (strncasecmp(sb_mountdata + off, "unc=", 4) == 0) {
                        off += noff;
                        continue;
--

2.30.2

Signature · 3 lines
Thanks,

Steve
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ronnie Sahlberg
Quoted 7 lines · Ronnie Sahlberg

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213565

cruid should only be used for the initial mount and after this we should use the current users credentials.
Ignore the original cruid mount argument when creating a new context for a multiuser mount following a DFS link.

Quoted 6 lines
Fixes 24e0a1eff9e2 ("cifs: switch to new mount api")
---
 fs/cifs/cifs_dfs_ref.c | 4 ++++
 1 file changed, 4 insertions(+)