[PATCH 5.0 25/52] cifs: allow guest mounts to work for smb3.11
From: Greg Kroah-Hartman
Date: Tue Mar 26 2019 - 02:41:58 EST
5.0-stable review patch. If anyone has any objections, please let me know.
From: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
commit e71ab2aa06f731a944993120b0eef1556c63b81c upstream.
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
Fixes: 6188f28bf608 ("Tree connect for SMB3.1.1 must be signed for non-encrypted shares")
Signed-off-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
CC: Stable <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
fs/cifs/smb2pdu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -1605,9 +1605,13 @@ SMB2_tcon(const unsigned int xid, struct
iov.iov_base = unc_path;
iov.iov_len = unc_path_len;
- /* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 22.214.171.124.1 */
+ * 3.11 tcon req must be signed if not encrypted. See MS-SMB2 126.96.36.199.1
+ * unless it is guest or anonymous user. See MS-SMB2 188.8.131.52.1
if ((ses->server->dialect == SMB311_PROT_ID) &&
+ !smb3_encryption_required(tcon) &&
+ !(ses->session_flags & (SMB2_SESSION_FLAG_IS_GUEST|SMB2_SESSION_FLAG_IS_NULL)))
req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
memset(&rqst, 0, sizeof(struct smb_rqst));