cifs: fix negotiate context parsing
authorDavid Disseldorp <ddiss@suse.de>
Thu, 6 Apr 2023 22:34:11 +0000 (00:34 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:26:42 +0000 (23:26 -0500)
commitb671d47eed142aa3a6bc0eb42c8d453d515ab4ce
tree346907d73abca12ca9adfd3f199b696e125e0c9c
parent73fd216d6e1b8baed0f1208dcd51f9f389d07c45
cifs: fix negotiate context parsing

smb311_decode_neg_context() doesn't properly check against SMB packet
boundaries prior to accessing individual negotiate context entries. This
is due to the length check omitting the eight byte smb2_neg_context
header, as well as incorrect decrementing of len_of_ctxts.

Fixes: 5100d8a3fe03 ("SMB311: Improve checking of negotiate security contexts")
Reported-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c