]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: avoid out of bounds access in decode_preauth_ctxt()
authorDavid Disseldorp <ddiss@suse.de>
Mon, 18 Dec 2023 15:33:42 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:54 +0000 (10:41 +0100)
commit39f5b4b313b445c980a2a295bed28228c29228ed
treeeca37a8ae9f6925858fd02ea3a2ba5bd09b95869
parent921536046bd165efeb07beef5630aff35cd6a489
ksmbd: avoid out of bounds access in decode_preauth_ctxt()

[ Upstream commit e7067a446264a7514fa1cfaa4052cdb6803bc6a2 ]

Confirm that the accessed pneg_ctxt->HashAlgorithms address sits within
the SMB request boundary; deassemble_neg_contexts() only checks that the
eight byte smb2_neg_context header + (client controlled) DataLength are
within the packet boundary, which is insufficient.

Checking for sizeof(struct smb2_preauth_neg_context) is overkill given
that the type currently assumes SMB311_SALT_SIZE bytes of trailing Salt.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/smb2pdu.c