]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.5/cifs-allow-guest-mounts-to-work-for-smb3.11.patch
Linux 5.0.5
[thirdparty/kernel/stable-queue.git] / releases / 5.0.5 / cifs-allow-guest-mounts-to-work-for-smb3.11.patch
1 From e71ab2aa06f731a944993120b0eef1556c63b81c Mon Sep 17 00:00:00 2001
2 From: Ronnie Sahlberg <lsahlber@redhat.com>
3 Date: Thu, 21 Mar 2019 14:59:02 +1000
4 Subject: cifs: allow guest mounts to work for smb3.11
5
6 From: Ronnie Sahlberg <lsahlber@redhat.com>
7
8 commit e71ab2aa06f731a944993120b0eef1556c63b81c upstream.
9
10 Fix Guest/Anonymous sessions so that they work with SMB 3.11.
11
12 The commit noted below tightened the conditions and forced signing for
13 the SMB2-TreeConnect commands as per MS-SMB2.
14 However, this should only apply to normal user sessions and not for
15 Guest/Anonumous sessions.
16
17 Fixes: 6188f28bf608 ("Tree connect for SMB3.1.1 must be signed for non-encrypted shares")
18
19 Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
20 CC: Stable <stable@vger.kernel.org>
21 Signed-off-by: Steve French <stfrench@microsoft.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 fs/cifs/smb2pdu.c | 8 ++++++--
26 1 file changed, 6 insertions(+), 2 deletions(-)
27
28 --- a/fs/cifs/smb2pdu.c
29 +++ b/fs/cifs/smb2pdu.c
30 @@ -1605,9 +1605,13 @@ SMB2_tcon(const unsigned int xid, struct
31 iov[1].iov_base = unc_path;
32 iov[1].iov_len = unc_path_len;
33
34 - /* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1 */
35 + /*
36 + * 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1
37 + * unless it is guest or anonymous user. See MS-SMB2 3.2.5.3.1
38 + */
39 if ((ses->server->dialect == SMB311_PROT_ID) &&
40 - !smb3_encryption_required(tcon))
41 + !smb3_encryption_required(tcon) &&
42 + !(ses->session_flags & (SMB2_SESSION_FLAG_IS_GUEST|SMB2_SESSION_FLAG_IS_NULL)))
43 req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
44
45 memset(&rqst, 0, sizeof(struct smb_rqst));