]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Set previous session id correctly on SMB3 reconnect
authorSteve French <smfrench@gmail.com>
Wed, 21 Sep 2016 03:56:13 +0000 (22:56 -0500)
committerJiri Slaby <jslaby@suse.cz>
Tue, 8 Nov 2016 15:38:17 +0000 (16:38 +0100)
commit c2afb8147e69819885493edf3a7c1ce03aaf2d4e upstream.

Signed-off-by: Steve French <steve.french@primarydata.com>
Reported-by: David Goebel <davidgoe@microsoft.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/cifs/smb2pdu.c
fs/cifs/smb2pdu.h

index ac76b1dab3b808df0949a730f3ffd56b99528d12..1a6dde4bce626c0652f557d14d1e7a140665aae0 100644 (file)
@@ -566,6 +566,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
        char *security_blob;
        char *ntlmssp_blob = NULL;
        bool use_spnego = false; /* else use raw ntlmssp */
+       u64 previous_session = ses->Suid;
 
        cifs_dbg(FYI, "Session Setup\n");
 
@@ -602,6 +603,10 @@ ssetup_ntlmssp_authenticate:
                return rc;
 
        req->hdr.SessionId = 0; /* First session, not a reauthenticate */
+
+       /* if reconnect, we need to send previous sess id, otherwise it is 0 */
+       req->PreviousSessionId = previous_session;
+
        req->VcNumber = 0; /* MBZ */
        /* to enable echos and oplocks */
        req->hdr.CreditRequest = cpu_to_le16(3);
index 6133a4e45c6e3a8f060db4b36ab0805693ba48db..efcc77b51556634af6cf12a3914feba208301c72 100644 (file)
@@ -228,7 +228,7 @@ struct smb2_sess_setup_req {
        __le32 Channel;
        __le16 SecurityBufferOffset;
        __le16 SecurityBufferLength;
-       __le64 PreviousSessionId;
+       __u64 PreviousSessionId;
        __u8   Buffer[1];       /* variable length GSS security buffer */
 } __packed;