[PATCH 5.13 003/351] cifs: Do not use the original cruid when following DFS links for multiuser mounts

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-07-19 17:22:51
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-07-19
From: Ronnie Sahlberg <redacted>

commit 50630b3f1ada0bf412d3f28e73bac310448d9d6f upstream.

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")
Cc: <redacted> # 5.11+
Reported-by: Xiaoli Feng <redacted>
Signed-off-by: Ronnie Sahlberg <redacted>
Reviewed-by: Paulo Alcantara (SUSE) <redacted>
Signed-off-by: Steve French <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/cifs/cifs_dfs_ref.c |    4 ++++
 1 file changed, 4 insertions(+)
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -208,6 +208,10 @@ char *cifs_compose_mount_options(const c
 		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;

Thread (353 messages) 353 messages, 2 authors, last reply 2021-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help