]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:37 +0000 (14:37 +0200)
commitfa19b53716f96b7f25b5c5baa05232a0cdc35e1f
tree41b4f9b84692e68389af3cf58e205cebc6cdb0db
parent68ee6f71a2a9bf9c1a68875162dc490f63d8447a
cifs: fix incorrect validation for num_aces field of smb_acl

[ Upstream commit aa2a739a75ab6f24ef72fb3fdb9192c081eacf06 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cifsacl.c