From 04b5575d8fc9b95f96f2a621169e45d995ee8a41 Mon Sep 17 00:00:00 2001 From: Apple Date: Sat, 16 Jul 2016 00:22:22 +0000 Subject: [PATCH] dyld-360.22.tar.gz --- src/dyld.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 ) -- 2.45.2