2dd7a3b
From: Sachin Prabhu <sprabhu@redhat.com>
2dd7a3b
Date: Wed, 3 Dec 2014 12:26:36 +0000
2dd7a3b
Subject: [PATCH] Set UID in sess_auth_rawntlmssp_authenticate too
2dd7a3b
2dd7a3b
A user complained that they were unable to login to their cifs share
2dd7a3b
after a kernel update. From the wiretrace we can see that the server
2dd7a3b
returns different UIDs as response to NTLMSSP_NEGOTIATE and NTLMSSP_AUTH
2dd7a3b
phases.
2dd7a3b
2dd7a3b
With changes in the authentication code, we no longer set the
2dd7a3b
cifs_sess->Suid returned in response to the NTLM_AUTH phase and continue
2dd7a3b
to use the UID sent in response to the NTLMSSP_NEGOTIATE phase. This
2dd7a3b
results in the server denying access to the user when the user attempts
2dd7a3b
to do a tcon connect.
2dd7a3b
2dd7a3b
See https://bugzilla.redhat.com/show_bug.cgi?id=1163927
2dd7a3b
2dd7a3b
A test kernel containing patch was tested successfully by the user.
2dd7a3b
2dd7a3b
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
2dd7a3b
Signed-off-by: Steve French <steve.french@primarydata.com>
2dd7a3b
---
2dd7a3b
 fs/cifs/sess.c | 5 +++++
2dd7a3b
 1 file changed, 5 insertions(+)
2dd7a3b
2dd7a3b
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
2dd7a3b
index 57db63ff88da..446cb7fb3f58 100644
2dd7a3b
--- a/fs/cifs/sess.c
2dd7a3b
+++ b/fs/cifs/sess.c
2dd7a3b
@@ -1303,6 +1303,11 @@ sess_auth_rawntlmssp_authenticate(struct sess_data *sess_data)
2dd7a3b
 	if (le16_to_cpu(pSMB->resp.Action) & GUEST_LOGIN)
2dd7a3b
 		cifs_dbg(FYI, "Guest login\n"); /* BB mark SesInfo struct? */
2dd7a3b
 
2dd7a3b
+	if (ses->Suid != smb_buf->Uid) {
2dd7a3b
+		ses->Suid = smb_buf->Uid;
2dd7a3b
+		cifs_dbg(FYI, "UID changed! new UID = %llu\n", ses->Suid);
2dd7a3b
+	}
2dd7a3b
+
2dd7a3b
 	bytes_remaining = get_bcc(smb_buf);
2dd7a3b
 	bcc_ptr = pByteArea(smb_buf);
2dd7a3b
 	blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength);
2dd7a3b
-- 
2dd7a3b
2.1.0
2dd7a3b