]> Gentwo Git Trees - 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>
Thu, 13 Feb 2025 14:01:28 +0000 (08:01 -0600)
commit21a8be57849a452f5c0c34b185aa869ed602f411
tree7919f5c332f013be23743811f9b427e087c7c272
parentf5b07a3350a24b994b639416db9d7b8b64f93540
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