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)
committerSteve French <stfrench@microsoft.com>
Sun, 6 Aug 2023 01:57:00 +0000 (20:57 -0500)
commit79ed288cef201f1f212dfb934bcaac75572fb8f6
tree5c150a82d16bcc035a83b130e4f1f2992a039db3
parent5aa4fda5aa9c2a5a7bac67b4a12b089ab81fee3c
ksmbd: fix wrong next length validation of ea buffer in smb2_set_ea()

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>
fs/smb/server/smb2pdu.c