]> www.infradead.org Git - users/jedix/linux-maple.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)
committerSteve French <stfrench@microsoft.com>
Mon, 3 Mar 2025 04:50:54 +0000 (22:50 -0600)
commit1b8b67f3c5e5169535e26efedd3e422172e2db64
treea0d75d0e83ec1edd0c9dc7d857c8fa93260889c4
parent62e7dd0a39c2d0d7ff03274c36df971f1b3d2d0d
ksmbd: fix incorrect validation for num_aces field of smb_acl

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