CVE-2015-7560: s3: smbd: Refuse to get an ACL from a POSIX file handle on a symlink.
authorJeremy Allison <jra@samba.org>
Tue, 5 Jan 2016 18:38:28 +0000 (10:38 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Feb 2016 10:38:52 +0000 (11:38 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/nttrans.c

index 131009b14c38f47c0531855f61713a69596eb797..5a6a784b16d2f341d7fc0a2ac9289f6e7e47b2bd 100644 (file)
@@ -1912,6 +1912,13 @@ NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
                return NT_STATUS_ACCESS_DENIED;
        }
 
+       if (S_ISLNK(fsp->fsp_name->st.st_ex_mode)) {
+               DEBUG(10, ("ACL get on symlink %s denied.\n",
+                       fsp_str_dbg(fsp)));
+               TALLOC_FREE(frame);
+               return NT_STATUS_ACCESS_DENIED;
+       }
+
        if (security_info_wanted & (SECINFO_DACL|SECINFO_OWNER|
                        SECINFO_GROUP|SECINFO_SACL)) {
                /* Don't return SECINFO_LABEL if anything else was