]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix out-of-bound read in smb2_write
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 15 Jun 2023 13:04:40 +0000 (22:04 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:13:58 +0000 (11:13 +0200)
commit58a9c41064df27632e780c5a3ae3e0e4284957d1
tree83b9cd6b88a40de9144cb02f4ce285412823acce
parent768caf4019f0391c0b6452afe34cea1704133f7b
ksmbd: fix out-of-bound read in smb2_write

commit 5fe7f7b78290638806211046a99f031ff26164e1 upstream.

ksmbd_smb2_check_message doesn't validate hdr->NextCommand. If
->NextCommand is bigger than Offset + Length of smb2 write, It will
allow oversized smb2 write length. It will cause OOB read in smb2_write.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21164
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/smb2misc.c