]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix incorrect validation for num_aces field of smb_acl
authorNamjae Jeon <linkinjeon@kernel.org>
Wed, 12 Feb 2025 00:32:11 +0000 (09:32 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:32:03 +0000 (14:32 +0200)
commitc3a3484d9d31b27a3db0fab91fcf191132d65236
tree61cdd37aadfc1604f695b3c82aa3bc0df435fa69
parent397e6aa03f9abf3018b23fdc39a5a75d5bead854
ksmbd: fix incorrect validation for num_aces field of smb_acl

[ Upstream commit 1b8b67f3c5e5169535e26efedd3e422172e2db64 ]

parse_dcal() validate num_aces to allocate posix_ace_state_array.

if (num_aces > ULONG_MAX / sizeof(struct smb_ace *))

It is an incorrect validation that we can create an array of size ULONG_MAX.
smb_acl has ->size field to calculate actual number of aces in request buffer
size. Use this to check invalid num_aces.

Reported-by: Igor Leite Ladessa <igor-ladessa@hotmail.com>
Tested-by: Igor Leite Ladessa <igor-ladessa@hotmail.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/ksmbd/smbacl.c