]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix wrong next length validation of ea buffer in smb2_set_ea()
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 5 Aug 2023 23:44:17 +0000 (08:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:21:57 +0000 (18:21 +0200)
commitaeb974907642be095e38ecb1a400ca583958b2b0
tree339f93f9bbe7231e158d55cdb654b36e57b4d0a8
parent595679098bdcdbfbba91ebe07a2f7f208df93870
ksmbd: fix wrong next length validation of ea buffer in smb2_set_ea()

commit 79ed288cef201f1f212dfb934bcaac75572fb8f6 upstream.

There are multiple smb2_ea_info buffers in FILE_FULL_EA_INFORMATION request
from client. ksmbd find next smb2_ea_info using ->NextEntryOffset of
current smb2_ea_info. ksmbd need to validate buffer length Before
accessing the next ea. ksmbd should check buffer length using buf_len,
not next variable. next is the start offset of current ea that got from
previous ea.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21598
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/smb2pdu.c