]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: fix incorrect validation for num_aces field of smb_acl
authorNamjae Jeon <linkinjeon@kernel.org>
Wed, 12 Feb 2025 00:37:57 +0000 (09:37 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 3 Mar 2025 04:50:54 +0000 (22:50 -0600)
commitaa2a739a75ab6f24ef72fb3fdb9192c081eacf06
tree7762449cd1dcce60eb17435b672d7f5fa42e43fe
parent1b8b67f3c5e5169535e26efedd3e422172e2db64
cifs: fix incorrect validation for num_aces field of smb_acl

parse_dcal() validate num_aces to allocate ace array.

f (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 response buffer
size. Use this to check invalid num_aces.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsacl.c