From: Noel Power <nopower-IBi9RG/b67k@public.gmane.org>
To: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
samba-technical
<samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org>
Subject: cifs client not forgiving enough when neg prot smb1 (with extended security)
Date: Wed, 27 May 2015 13:06:23 +0100 [thread overview]
Message-ID: <5565B33F.2020302@suse.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
Hi Steve,
Just came across a situation where cifs client was failing to mount a
share with ntlmssp served by cifsd based server.
The server is misbehaving in that is should have set the
EncryptionKeyLength to zero (when offering extended security).
Regardless though, a windows client will happily continue whereas the
cifs client will return IO(5) error. Looking in the MS-SMB spec
(2.2.4.5.2.1) mentions
"ChallengeLength (1 byte): When the CAP_EXTENDED_SECURITY bit is set,
the server MUST set this value to zero and clients MUST ignore this value."
I attach a patch to cifs for this
thanks,
Noel
[-- Attachment #2: 0001-client-MUST-ignore-EncryptionKeyLength-if-CAP_EXTEND.patch --]
[-- Type: text/plain, Size: 1305 bytes --]
From ccd99a91f3b73e4281cabd8dd84b0e46bff71865 Mon Sep 17 00:00:00 2001
From: Noel Power <noel.power@suse.com>
Date: Wed, 27 May 2015 09:22:10 +0100
Subject: [PATCH] client MUST ignore EncryptionKeyLength if
CAP_EXTENDED_SECURITY is set
[MS-SMB] 2.2.4.5.2.1 states:
"ChallengeLength (1 byte): When the CAP_EXTENDED_SECURITY bit is set,
the server MUST set this value to zero and clients MUST ignore this
value."
Signed-off-by: Noel Power <noel.power@suse.com>
---
fs/cifs/cifssmb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 5f1f328..ea938a8 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -629,9 +629,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
server->negflavor = CIFS_NEGFLAVOR_UNENCAP;
memcpy(ses->server->cryptkey, pSMBr->u.EncryptionKey,
CIFS_CRYPTO_KEY_SIZE);
- } else if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
- server->capabilities & CAP_EXTENDED_SECURITY) &&
- (pSMBr->EncryptionKeyLength == 0)) {
+ } else if (pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
+ server->capabilities & CAP_EXTENDED_SECURITY) {
server->negflavor = CIFS_NEGFLAVOR_EXTENDED;
rc = decode_ext_sec_blob(ses, pSMBr);
} else if (server->sec_mode & SECMODE_PW_ENCRYPT) {
--
1.8.5.6
next reply other threads:[~2015-05-27 12:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 12:06 Noel Power [this message]
[not found] ` <5565B33F.2020302-IBi9RG/b67k@public.gmane.org>
2015-05-28 22:18 ` cifs client not forgiving enough when neg prot smb1 (with extended security) Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5565B33F.2020302@suse.com \
--to=nopower-ibi9rg/b67k@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=noel.power-IBi9RG/b67k@public.gmane.org \
--cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox