]> git.ipfire.org Git - thirdparty/linux.git/commit
ksmbd: validate ACE size against SID sub-authorities
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 4 Jul 2026 02:07:51 +0000 (11:07 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 22 Jul 2026 14:54:10 +0000 (09:54 -0500)
commit5152c6d49e3fd4e9f2e857c57527aead752f1f87
treeb2187df63b539c9002e79b35dc84fb8a2da87e1e
parentbbf0a8e931204ecdab494a88d43b0a24a04285c5
ksmbd: validate ACE size against SID sub-authorities

set_ntacl_dacl() validates sid.num_subauth before copying an ACE, but
does not verify that the declared ACE size contains all sub-authorities
described by that field. An undersized ACE can therefore be copied
and later make the POSIX ACL deduplication walk inspect data beyond
the copied ACE boundary.

The existing initial bound check is also too small. It only ensures
that the ACE size field is accessible before set_ntacl_dacl() reads
sid.num_subauth farther into the input buffer.

Require enough input for the fixed SID header before accessing
num_subauth, reject ACEs smaller than that header, and skip ACEs
whose declared size cannot contain the complete SID. This makes the
validation consistent with the other ACE walk paths.

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