From: Apple Date: Sat, 16 Jul 2016 00:22:22 +0000 (+0000) Subject: dyld-360.22.tar.gz X-Git-Tag: os-x-10115^0 X-Git-Url: https://git.saurik.com/apple/dyld.git/commitdiff_plain/04b5575d8fc9b95f96f2a621169e45d995ee8a41 dyld-360.22.tar.gz --- diff --git a/src/dyld.cpp b/src/dyld.cpp index 39f254c..8fb0f24 100644 --- a/src/dyld.cpp +++ b/src/dyld.cpp @@ -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; - + + // 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 )