summaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-25 13:17:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-25 13:17:53 -0700
commit04faac10fcd2d0f7af8183fa02dea26919e29571 (patch)
treed5c0877e3f1d1922556effb78c30a14c9d823370 /fs/cifs/sess.c
parent1b2de5d039c883c9d44ae5b2b6eca4ff9bd82dac (diff)
parent7753e38286d2bd7380df8be843de83198e2ce492 (diff)
downloadlinux-04faac10fcd2d0f7af8183fa02dea26919e29571.tar.bz2
Merge tag '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Three small SMB3 fixes, one for stable" * tag '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number for cifs.ko to 2.12 cifs: check kmalloc before use cifs: check if SMB2 PDU size has been padded and suppress the warning cifs: create a define for how many iovs we need for an SMB2_open()
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 8b0502cd39af..aa23c00367ec 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -398,6 +398,12 @@ int build_ntlmssp_auth_blob(unsigned char **pbuffer,
goto setup_ntlmv2_ret;
}
*pbuffer = kmalloc(size_of_ntlmssp_blob(ses), GFP_KERNEL);
+ if (!*pbuffer) {
+ rc = -ENOMEM;
+ cifs_dbg(VFS, "Error %d during NTLMSSP allocation\n", rc);
+ *buflen = 0;
+ goto setup_ntlmv2_ret;
+ }
sec_blob = (AUTHENTICATE_MESSAGE *)*pbuffer;
memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8);