From: Volker Lendecke Date: Fri, 2 Aug 2024 11:06:28 +0000 (+0200) Subject: smbd: protect check_smb2_posix_chmod_ace against invalid trustees X-Git-Tag: tdb-1.4.13~1425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=51ce5ce7094d4e2190a9eb45a2cfea2e0cffa3c2;p=thirdparty%2Fsamba.git smbd: protect check_smb2_posix_chmod_ace against invalid trustees Found because I got this wrong in new code coming soon Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_nttrans.c b/source3/smbd/smb2_nttrans.c index 44aab9af34b..f61848334ba 100644 --- a/source3/smbd/smb2_nttrans.c +++ b/source3/smbd/smb2_nttrans.c @@ -204,6 +204,10 @@ static bool check_smb2_posix_chmod_ace(const struct files_struct *fsp, return false; } + if (psd->dacl->aces[0].trustee.num_auths != 3) { + return false; + } + cmp = dom_sid_compare_domain(&global_sid_Unix_NFS_Mode, &psd->dacl->aces[0].trustee); if (cmp != 0) {