]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: bound DACL dedup walk to copied ACEs
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 3 Jul 2026 01:54:19 +0000 (10:54 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 22 Jul 2026 14:54:10 +0000 (09:54 -0500)
commit58d97fcd0bf1aee694e244cc28635b9df95b543b
treedab666b6e63d9d74ec47e725ad61aa1d66a14ac8
parent2bebf2470af1a72f87754a5c7b21e86af32b9c8f
ksmbd: bound DACL dedup walk to copied ACEs

set_ntacl_dacl() can stop copying ACEs before consuming the full input
DACL when size accounting overflows.

When that happens, num_aces reflects only the ACEs that were actually
copied into the output DACL, but set_posix_acl_entries_dacl() still
receives nt_num_aces and uses it to walk the existing ACE array during
dedup.

That makes the dedup walk scan past the copied ACE array and inspect
buffer tail that does not contain valid ACEs.

Split the two meanings currently carried by the NT ACE count. Pass the
number of copied NT ACEs to bound the dedup walk, and preserve the
original "input DACL had NT ACEs" state separately for the
Everyone/default ACL fallback.

This keeps the dedup walk aligned with the ACEs that are actually
present in the rebuilt DACL.

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