Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] cifs: allow guest mounts to work for smb3.11
@ 2019-03-21  4:59 Ronnie Sahlberg
  2019-03-21 11:46 ` Aurélien Aptel
  2019-03-21 17:13 ` Andreas Hasenack
  0 siblings, 2 replies; 9+ messages in thread
From: Ronnie Sahlberg @ 2019-03-21  4:59 UTC (permalink / raw)
  To: linux-cifs; +Cc: Steve French, Stable, Ronnie Sahlberg

Fix Guest/Anonymous sessions so that they work with SMB 3.11.

In git commit 6188f28 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.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
---
 fs/cifs/smb2pdu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index c399e09b76e6..8e4a1da95418 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1628,9 +1628,13 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 	iov[1].iov_base = unc_path;
 	iov[1].iov_len = unc_path_len;
 
-	/* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1 */
+	/*
+	 * 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1
+	 * unless it is guest or anonymous user. See MS-SMB2 3.2.5.3.1
+	 */
 	if ((ses->server->dialect == SMB311_PROT_ID) &&
-	    !smb3_encryption_required(tcon))
+	    !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));
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-23  1:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-21  4:59 [PATCH] cifs: allow guest mounts to work for smb3.11 Ronnie Sahlberg
2019-03-21 11:46 ` Aurélien Aptel
2019-03-21 15:36   ` Steve French
2019-03-21 17:13 ` Andreas Hasenack
2019-03-21 19:54   ` ronnie sahlberg
2019-03-22 23:30     ` Steve French
2019-03-23  0:20       ` Tom Talpey
2019-03-23  0:41         ` Steve French
2019-03-23  1:27           ` Tom Talpey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox