Skip to content

Commit 4b081ce

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: fix slub overflow in ksmbd_decode_ntlmssp_auth_blob()
If authblob->SessionKey.Length is bigger than session key size(CIFS_KEY_SIZE), slub overflow can happen in key exchange codes. cifs_arc4_crypt copy to session key array from SessionKey from client. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21940 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 17d5b13 commit 4b081ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/smb/server/auth.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob,
355355
if (blob_len < (u64)sess_key_off + sess_key_len)
356356
return -EINVAL;
357357

358+
if (sess_key_len > CIFS_KEY_SIZE)
359+
return -EINVAL;
360+
358361
ctx_arc4 = kmalloc(sizeof(*ctx_arc4), GFP_KERNEL);
359362
if (!ctx_arc4)
360363
return -ENOMEM;

0 commit comments

Comments
 (0)