Skip to content

Commit e71ab2a

Browse files
Ronnie SahlbergSteve French
authored andcommitted
cifs: allow guest mounts to work for smb3.11
Fix Guest/Anonymous sessions so that they work with SMB 3.11. The commit noted below tightened the conditions and forced signing for the SMB2-TreeConnect commands as per MS-SMB2. However, this should only apply to normal user sessions and not for Guest/Anonumous sessions. Fixes: 6188f28 ("Tree connect for SMB3.1.1 must be signed for non-encrypted shares") Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> CC: Stable <stable@vger.kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 85f9987 commit e71ab2a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/cifs/smb2pdu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,9 +1628,13 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
16281628
iov[1].iov_base = unc_path;
16291629
iov[1].iov_len = unc_path_len;
16301630

1631-
/* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1 */
1631+
/*
1632+
* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1
1633+
* unless it is guest or anonymous user. See MS-SMB2 3.2.5.3.1
1634+
*/
16321635
if ((ses->server->dialect == SMB311_PROT_ID) &&
1633-
!smb3_encryption_required(tcon))
1636+
!smb3_encryption_required(tcon) &&
1637+
!(ses->session_flags & (SMB2_SESSION_FLAG_IS_GUEST|SMB2_SESSION_FLAG_IS_NULL)))
16341638
req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
16351639

16361640
memset(&rqst, 0, sizeof(struct smb_rqst));

0 commit comments

Comments
 (0)