]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 16 Mar 2024 14:36:36 +0000 (23:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:32:24 +0000 (15:32 +0200)
commit4f97e6a9d62cb1fce82fbf4baff44b83221bc178
tree9f2560f0b65f11945566dbd4a0a4991363d4dddf
parentff2f9c4ebe7f9f9653a148266f47e5f09e683250
ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()

[ Upstream commit a80a486d72e20bd12c335bcd38b6e6f19356b0aa ]

If ->NameOffset of smb2_create_req is smaller than Buffer offset of
smb2_create_req, slab-out-of-bounds read can happen from smb2_open.
This patch set the minimum value of the name offset to the buffer offset
to validate name length of smb2_create_req().

Cc: stable@vger.kernel.org
Reported-by: Xuanzhe Yu <yuxuanzhe@outlook.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/smb2misc.c