]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: Fix buffer length check in fsctl_validate_negotiate_info()
authorMarios Makassikis <mmakassikis@freebox.fr>
Thu, 28 Oct 2021 19:01:27 +0000 (21:01 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 7 Nov 2021 04:52:06 +0000 (23:52 -0500)
commit98d04737a7808024f709cfae8df973916428ff27
treea27799c1a5e4940506b28be483d23c956e72a536
parent247fec55baf8534290eee5fbf6158fffd7a304fd
ksmbd: Fix buffer length check in fsctl_validate_negotiate_info()

The validate_negotiate_info_req struct definition includes an extra
field to access the data coming after the header. This causes the check
in fsctl_validate_negotiate_info() to count the first element of the
array twice. This in turn makes some valid requests fail, depending on
whether they include padding or not.

Fixes: 1465e8a8b5bf ("ksmbd: add validation in smb2_ioctl")
Cc: stable@vger.kernel.org # v5.15
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Acked-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c