forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't try to allocate JIT memory if we don't have the JIT entitlement
https://bugs.webkit.org/show_bug.cgi?id=182605 <rdar://problem/38271229> Patch by Tadeu Zagallo <[email protected]> on 2018-06-07 Reviewed by Mark Lam. Source/JavaScriptCore: Check that the current process has the correct entitlements before trying to allocate JIT memory to silence warnings. * jit/ExecutableAllocator.cpp: (JSC::allowJIT): Helper that checks entitlements on iOS and returns true in other platforms (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): check allowJIT before trying to allocate Source/WebKit: Remove processHasEntitlement, which was moved into WTF and update all call sites. * Shared/mac/SandboxUtilities.h: * Shared/mac/SandboxUtilities.mm: (WebKit::processHasEntitlement): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/ApplicationStateTracker.mm: (WebKit::applicationType): * UIProcess/ios/WKActionSheetAssistant.mm: (applicationHasAppLinkEntitlements): Source/WTF: Move processHasEntitlement from Source/WebKit/Shared/mac/SandboxUtilities.h into WTF so JavaScriptCore can also use it. * WTF.xcodeproj/project.pbxproj: * wtf/PlatformMac.cmake: * wtf/cocoa/Entitlements.cpp: (WTF::processHasEntitlement): * wtf/cocoa/Entitlements.h: * wtf/spi/cocoa/SecuritySPI.h: Tools: Add the Security framework to the TestWTF target, since it's required by the new function to check the entitlements. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@232604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
c298f47
commit b311a04
Showing
16 changed files
with
186 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
2018-06-07 Tadeu Zagallo <[email protected]> | ||
|
||
Don't try to allocate JIT memory if we don't have the JIT entitlement | ||
https://bugs.webkit.org/show_bug.cgi?id=182605 | ||
<rdar://problem/38271229> | ||
|
||
Reviewed by Mark Lam. | ||
|
||
Check that the current process has the correct entitlements before | ||
trying to allocate JIT memory to silence warnings. | ||
|
||
* jit/ExecutableAllocator.cpp: | ||
(JSC::allowJIT): Helper that checks entitlements on iOS and returns true in other platforms | ||
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): check allowJIT before trying to allocate | ||
|
||
2018-06-07 Saam Barati <[email protected]> | ||
|
||
TierUpCheckInjectionPhase systematically never puts the outer-most loop in an inner loop's vector of outer loops | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
2018-06-07 Tadeu Zagallo <[email protected]> | ||
|
||
Don't try to allocate JIT memory if we don't have the JIT entitlement | ||
https://bugs.webkit.org/show_bug.cgi?id=182605 | ||
<rdar://problem/38271229> | ||
|
||
Reviewed by Mark Lam. | ||
|
||
Move processHasEntitlement from Source/WebKit/Shared/mac/SandboxUtilities.h | ||
into WTF so JavaScriptCore can also use it. | ||
|
||
* WTF.xcodeproj/project.pbxproj: | ||
* wtf/PlatformMac.cmake: | ||
* wtf/cocoa/Entitlements.cpp: | ||
(WTF::processHasEntitlement): | ||
* wtf/cocoa/Entitlements.h: | ||
* wtf/spi/cocoa/SecuritySPI.h: | ||
|
||
2018-06-05 Darin Adler <[email protected]> | ||
|
||
[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2018 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "config.h" | ||
#include "Entitlements.h" | ||
|
||
#include <wtf/RetainPtr.h> | ||
#include <wtf/spi/cocoa/SecuritySPI.h> | ||
|
||
namespace WTF { | ||
|
||
bool processHasEntitlement(const char* entitlement) | ||
{ | ||
auto task = adoptCF(SecTaskCreateFromSelf(kCFAllocatorDefault)); | ||
if (!task) | ||
return false; | ||
|
||
auto cfEntitlement = adoptCF(CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, entitlement, kCFStringEncodingUTF8, kCFAllocatorNull)); | ||
auto value = adoptCF(SecTaskCopyValueForEntitlement(task.get(), cfEntitlement.get(), nullptr)); | ||
if (!value) | ||
return false; | ||
|
||
if (CFGetTypeID(value.get()) != CFBooleanGetTypeID()) | ||
return false; | ||
|
||
return CFBooleanGetValue(static_cast<CFBooleanRef>(value.get())); | ||
} | ||
|
||
} // namespace WTF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2018 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#if PLATFORM(COCOA) | ||
|
||
namespace WTF { | ||
|
||
WTF_EXPORT bool processHasEntitlement(const char* entitlement); | ||
|
||
} // namespace WTF | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
2018-06-07 Tadeu Zagallo <[email protected]> | ||
|
||
Don't try to allocate JIT memory if we don't have the JIT entitlement | ||
https://bugs.webkit.org/show_bug.cgi?id=182605 | ||
<rdar://problem/38271229> | ||
|
||
Reviewed by Mark Lam. | ||
|
||
Remove processHasEntitlement, which was moved into WTF and update all call sites. | ||
|
||
* Shared/mac/SandboxUtilities.h: | ||
* Shared/mac/SandboxUtilities.mm: | ||
(WebKit::processHasEntitlement): Deleted. | ||
* UIProcess/API/Cocoa/WKWebView.mm: | ||
(-[WKWebView _initializeWithConfiguration:]): | ||
* UIProcess/ApplicationStateTracker.mm: | ||
(WebKit::applicationType): | ||
* UIProcess/ios/WKActionSheetAssistant.mm: | ||
(applicationHasAppLinkEntitlements): | ||
|
||
2018-06-07 Tim Horton <[email protected]> | ||
|
||
REGRESSION (r232544): Pages are blank after homing out and then resuming on iPad | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
2018-06-07 Tadeu Zagallo <[email protected]> | ||
|
||
Don't try to allocate JIT memory if we don't have the JIT entitlement | ||
https://bugs.webkit.org/show_bug.cgi?id=182605 | ||
<rdar://problem/38271229> | ||
|
||
Reviewed by Mark Lam. | ||
|
||
Add the Security framework to the TestWTF target, since it's required by the new function to check the entitlements. | ||
|
||
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: | ||
|
||
2018-06-07 Mark Lam <[email protected]> | ||
|
||
Enhance run-jsc-stress-tests to allow a test to specify test specific options required for it to run. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters