From 00401ff780c58b9dabffef668386c206efc71c7c Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 23 Jul 2012 13:14:28 -0400 Subject: cifs: after upcalling for krb5 creds, invalidate key rather than revoking it Calling key_revoke here isn't ideal as further requests for the key will end up returning -EKEYREVOKED until it gets purged from the cache. What we really intend here is to force a new upcall on the next request_key. Cc: David Howells Signed-off-by: Jeff Layton Signed-off-by: Steve French --- fs/cifs/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 551d0c2b973..b4219789049 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -938,7 +938,7 @@ ssetup_ntlmssp_authenticate: ssetup_exit: if (spnego_key) { - key_revoke(spnego_key); + key_invalidate(spnego_key); key_put(spnego_key); } kfree(str_area); -- cgit v1.2.3 From 286170aa241819f39d9d1d5d9f2434cfb8519506 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Fri, 25 May 2012 10:43:58 +0400 Subject: CIFS: Move protocol specific negotiate code to ops struct Reviewed-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index b4219789049..3ba3f3cd239 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -898,7 +898,7 @@ ssetup_ntlmssp_authenticate: if (action & GUEST_LOGIN) cFYI(1, "Guest login"); /* BB mark SesInfo struct? */ ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ - cFYI(1, "UID = %d ", ses->Suid); + cFYI(1, "UID = %llu ", ses->Suid); /* response can have either 3 or 4 word count - Samba sends 3 */ /* and lanman response is 3 */ bytes_remaining = get_bcc(smb_buf); -- cgit v1.2.3 From 58c45c58a1cbc8d2e1d07839820bf745fb3e7f41 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Fri, 25 May 2012 10:54:49 +0400 Subject: CIFS: Move protocol specific session setup/logoff code to ops struct Reviewed-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 3ba3f3cd239..08efc3c8efe 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -556,7 +556,7 @@ setup_ntlmv2_ret: } int -CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses, +CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses, const struct nls_table *nls_cp) { int rc = 0; -- cgit v1.2.3 From 5478f9ba9a34d660eb3227dcd16314689c51f946 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Tue, 27 Dec 2011 16:22:00 +0400 Subject: CIFS: Add session setup/logoff capability for SMB2 Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/sess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 08efc3c8efe..382c06d01b3 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -364,7 +364,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft, return rc; } -static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, +int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, struct cifs_ses *ses) { unsigned int tioffset; /* challenge message target info area */ @@ -415,7 +415,7 @@ static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, /* We do not malloc the blob, it is passed in pbuffer, because it is fixed size, and small, making this approach cleaner */ -static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, +void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, struct cifs_ses *ses) { NEGOTIATE_MESSAGE *sec_blob = (NEGOTIATE_MESSAGE *)pbuffer; @@ -451,7 +451,7 @@ static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, /* We do not malloc the blob, it is passed in pbuffer, because its maximum possible size is fixed and small, making this approach cleaner. This function returns the length of the data in the blob */ -static int build_ntlmssp_auth_blob(unsigned char *pbuffer, +int build_ntlmssp_auth_blob(unsigned char *pbuffer, u16 *buflen, struct cifs_ses *ses, const struct nls_table *nls_cp) -- cgit v1.2.3 From f065fd099fc475333fc7a55677a7f64764445d55 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Tue, 25 Sep 2012 11:00:08 +0400 Subject: CIFS: Fix possible freed pointer dereference in CIFS_SessSetup Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/sess.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 382c06d01b3..76809f4d342 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -876,7 +876,8 @@ ssetup_ntlmssp_authenticate: pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base; smb_buf = (struct smb_hdr *)iov[0].iov_base; - if ((type == RawNTLMSSP) && (smb_buf->Status.CifsError == + if ((type == RawNTLMSSP) && (resp_buf_type != CIFS_NO_BUFFER) && + (smb_buf->Status.CifsError == cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) { if (phase != NtLmNegotiate) { cERROR(1, "Unexpected more processing error"); -- cgit v1.2.3