Skip to content

Commit

Permalink
cifs: Do not use the original cruid when following DFS links for mult…
Browse files Browse the repository at this point in the history
…iuser mounts

commit 50630b3 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: 24e0a1e ("cifs: switch to new mount api")
Cc: stable@vger.kernel.org # 5.11+
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ronnie Sahlberg authored and gregkh committed Jul 20, 2021
1 parent 0c480c4 commit d4e376c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/cifs/cifs_dfs_ref.c
Expand Up @@ -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;
Expand Down

0 comments on commit d4e376c

Please sign in to comment.