]> git.saurik.com Git - apple/dyld.git/commitdiff
dyld-360.22.tar.gz os-x-10115 os-x-10116 v360.22
authorApple <opensource@apple.com>
Sat, 16 Jul 2016 00:22:22 +0000 (00:22 +0000)
committerApple <opensource@apple.com>
Sat, 16 Jul 2016 00:22:22 +0000 (00:22 +0000)
src/dyld.cpp

index 39f254c404529b852118787aa29c075246038f03..8fb0f249c0329c1620ee4b7ca513291292c7f432 100644 (file)
@@ -4549,7 +4549,18 @@ static uintptr_t useSimulatorDyld(int fd, const macho_header* mainExecutableMH,
                                                                int argc, const char* argv[], const char* envp[], const char* apple[], uintptr_t* startGlue)
 {
        *startGlue = 0;
-       
+
+       // <rdar://problem/25311921> simulator does not support restricted processes
+       uint32_t flags;
+       if ( csops(0, CS_OPS_STATUS, &flags, sizeof(flags)) == -1 )
+               return 0;
+       if ( (flags & CS_RESTRICT) == CS_RESTRICT )
+               return 0;
+       if ( issetugid() )
+               return 0;
+       if ( hasRestrictedSegment(mainExecutableMH) )
+               return 0;
+
        // verify simulator dyld file is owned by root
        struct stat sb;
        if ( fstat(fd, &sb) == -1 )