]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
cifs: fix negotiate context parsing
authorDavid Disseldorp <ddiss@suse.de>
Thu, 6 Apr 2023 22:34:11 +0000 (00:34 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Wed, 17 May 2023 11:34:15 +0000 (13:34 +0200)
commit6c632fbfdecc30a7a6fc43281496fdc91fc077f0
tree18a8aa5829d3f9c99faa63a668c72f5358b799c5
parent0625403156cc81f5e8a87330486af1a2b4c12648
cifs: fix negotiate context parsing

BugLink: https://bugs.launchpad.net/bugs/2017219
[ Upstream commit 5105a7ffce19160e7062aee67fb6b3b8a1b56d78 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/cifs/smb2pdu.c