diff options
author | Aurelien Aptel <aaptel@suse.com> | 2018-02-16 19:19:29 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-04-01 20:24:40 -0500 |
commit | 8bd68c6e47abff34e412a0c68cecb4a36bf0198b (patch) | |
tree | 843fb398bb4b5f6ee1e6a5235bb9ce57a8d4b477 /fs/cifs/transport.c | |
parent | 5fcd7f3f966f37f3f9a215af4cc1597fe338d0d5 (diff) | |
download | linux-stable-8bd68c6e47abff34e412a0c68cecb4a36bf0198b.tar.gz linux-stable-8bd68c6e47abff34e412a0c68cecb4a36bf0198b.tar.bz2 linux-stable-8bd68c6e47abff34e412a0c68cecb4a36bf0198b.zip |
CIFS: implement v3.11 preauth integrity
SMB3.11 clients must implement pre-authentification integrity.
* new mechanism to certify requests/responses happening before Tree
Connect.
* supersedes VALIDATE_NEGOTIATE
* fixes signing for SMB3.11
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 9779b3292d8e..665661464067 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -37,6 +37,7 @@ #include "cifsglob.h" #include "cifsproto.h" #include "cifs_debug.h" +#include "smb2proto.h" #include "smbdirect.h" /* Max number of iovectors we can use off the stack when sending requests. */ @@ -751,6 +752,12 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, if (rc < 0) goto out; +#ifdef CONFIG_CIFS_SMB311 + if (ses->status == CifsNew) + smb311_update_preauth_hash(ses, rqst->rq_iov+1, + rqst->rq_nvec-1); +#endif + if (timeout == CIFS_ASYNC_OP) goto out; @@ -789,6 +796,16 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, else *resp_buf_type = CIFS_SMALL_BUFFER; +#ifdef CONFIG_CIFS_SMB311 + if (ses->status == CifsNew) { + struct kvec iov = { + .iov_base = buf + 4, + .iov_len = get_rfc1002_length(buf) + }; + smb311_update_preauth_hash(ses, &iov, 1); + } +#endif + credits = ses->server->ops->get_credits(midQ); rc = ses->server->ops->check_receive(midQ, ses->server, |