Patch "Fix encryption labels and lengths for SMB3.1.1" has been added to the 4.13-stable tree
This is a note to let you know that I've just added the patch titled
Fix encryption labels and lengths for SMB3.1.1
to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
fix-encryption-labels-and-lengths-for-smb3.1.1.patch
and it can be found in the queue-4.13 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
06e2290844fa408d3295ac03a1647f0798518ebeMon Sep 17 00:00:00 2001
From: Steve French <[email protected]>
Date: Mon, 25 Sep 2017 20:11:58 -0500
Subject: Fix encryption labels and lengths for SMB3.1.1
From: Steve French <[email protected]>
commit 06e2290844fa408d3295ac03a1647f0798518ebe upstream.
SMB3.1.1 is most secure and recent dialect. Fixup labels and lengths for sMB3.1.1 signing and encryption.
--- fs/cifs/cifsglob.h | 8 ++++++-- fs/cifs/smb2transport.c | 26 ++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-)
fs/cifs/cifsglob.h +6 -2
@@ -661,7 +661,9 @@ struct TCP_Server_Info {#endif unsigned int max_read;unsigned int max_write; -__u8 preauth_hash[512 ]; +#ifdef CONFIG_CIFS_SMB311 +__u8 preauth_sha_hash[64 ];/* save initital negprot hash */ +#endif /* 3.1.1 */ struct delayed_work reconnect;/* reconnect workqueue job */ struct mutex reconnect_mutex;/* prevent simultaneous reconnects */ unsigned long echo_interval;
@@ -849,7 +851,9 @@ struct cifs_ses {__u8 smb3signingkey[SMB3_SIGN_KEY_SIZE ];__u8 smb3encryptionkey[SMB3_SIGN_KEY_SIZE ];__u8 smb3decryptionkey[SMB3_SIGN_KEY_SIZE ]; -__u8 preauth_hash[512 ]; +#ifdef CONFIG_CIFS_SMB311 +__u8 preauth_sha_hash[64 ]; +#endif /* 3.1.1 */ }; static inline bool
fs/cifs/smb2transport.c +14 -12
@@ -390,6 +390,7 @@ generate_smb30signingkey(struct cifs_sesreturn generate_smb3signingkey (ses, &triplet); } +#ifdef CONFIG_CIFS_SMB311 int generate_smb311signingkey (struct cifs_ses *ses)
@@ -398,25 +399,26 @@ generate_smb311signingkey(struct cifs_sestruct derivation *d; d = &triplet.signing; - d->label.iov_base ="SMB2AESCMAC" ; - d->label.iov_len =12 ; - d->context.iov_base ="SmbSign" ; - d->context.iov_len =8 ; + d->label.iov_base ="SMBSigningKey" ; + d->label.iov_len =14 ; + d->context.iov_base = ses->preauth_sha_hash; + d->context.iov_len =64 ; d = &triplet.encryption; - d->label.iov_base ="SMB2AESCCM" ; - d->label.iov_len =11 ; - d->context.iov_base ="ServerIn " ; - d->context.iov_len =10 ; + d->label.iov_base ="SMBC2SCipherKey" ; + d->label.iov_len =16 ; + d->context.iov_base = ses->preauth_sha_hash; + d->context.iov_len =64 ; d = &triplet.decryption; - d->label.iov_base ="SMB2AESCCM" ; - d->label.iov_len =11 ; - d->context.iov_base ="ServerOut" ; - d->context.iov_len =10 ; + d->label.iov_base ="SMBS2CCipherKey" ; + d->label.iov_len =16 ; + d->context.iov_base = ses->preauth_sha_hash; + d->context.iov_len =64 ; return generate_smb3signingkey(ses, &triplet); } +#endif /* 311 */ int smb3_calc_signature (struct smb_rqst *rqst,struct TCP_Server_Info *server)
Patches currently in stable-queue which might be from [email protected] are
queue-4.13/cifs-fix-null-pointer-deref-on-smb2_tcon-failure.patch queue-4.13/cifs-select-all-required-crypto-modules.patch queue-4.13/smb3-validate-negotiate-request-must-always-be-signed.patch queue-4.13/fix-encryption-labels-and-lengths-for-smb3.1.1.patch