Changeset 228620 in webkit
- Timestamp:
- Feb 19, 2018 1:12:12 AM (6 years ago)
- Location:
- releases/WebKitGTK/webkit-2.20/Source/bmalloc
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.20/Source/bmalloc/CMakeLists.txt
r226972 r228620 35 35 if (CMAKE_SYSTEM_NAME MATCHES "Darwin") 36 36 list(APPEND bmalloc_SOURCES 37 bmalloc/ProcessCheck.mm 37 38 bmalloc/Zone.cpp 38 39 ) -
releases/WebKitGTK/webkit-2.20/Source/bmalloc/ChangeLog
r228619 r228620 1 2018-02-05 JF Bastien <jfbastien@apple.com> 2 3 Gigacage: enable only for WebContent process and token executables 4 https://bugs.webkit.org/show_bug.cgi?id=182457 5 <rdar://problem/35875011> 6 7 Reviewed by Keith Miller. 8 9 Gigacage is a solid security improvement, but it's probably best 10 to roll it out incrementally to the most valuable targets first 11 and progressively try out more and more over time rather than 12 outright enabling it everywhere. We've gotten some reports that it 13 has some side-effects that weren't expected, so for now let's 14 enable it for the WebContent process, JSC, and other executables 15 we know, and then later we'll enable more gigacage uses. 16 17 For now I've chosen the following bundles: 18 19 - com.apple.WebKit.WebContent.Development 20 - com.apple.WebKit.WebContent 21 - com.apple.WebProcess 22 23 And the following processes: 24 25 - jsc 26 - wasm 27 - anything starting with "test", to match the JSC tests 28 29 I tried a different approach first, where I add a function to turn 30 gigacage on or off and crash if gigacage is initialized without 31 having been told what to do. Doing this in ChildProcess and a 32 bunch of the process initialization methods isn't sufficient. I 33 got MiniBrowser working, but some other builds use static globals 34 which themselves use hash and string which are allocate with 35 bmalloc and therefore which initialize gigacage before main is 36 called and before the process gets a chance to opt in our out. It 37 gets tricky with API calls too, because we have to do the right 38 thing in any entry an API user could plausibly use, even the 39 private ones, so I endend up having to initialize gigacage in e.g. 40 WebPreferencesExperimentalFeatures.cpp.erb. 41 42 Another approach could be to create a free-for-all gigacage 43 entitlement, and opt-in the processes we want.. 44 45 As a follow-up we can also check that gigacage allocation always 46 succeeds if it was allowed for that process. With my change I 47 expect it to always succeed. 48 49 * CMakeLists.txt: 50 * bmalloc.xcodeproj/project.pbxproj: 51 * bmalloc/BPlatform.h: 52 * bmalloc/Gigacage.cpp: 53 (Gigacage::shouldBeEnabled): 54 * bmalloc/ProcessCheck.h: Added. 55 (bmalloc::gigacageEnabledForProcess): 56 * bmalloc/ProcessCheck.mm: Added. 57 (bmalloc::gigacageEnabledForProcess): 58 1 59 2018-02-05 Joseph Pecoraro <pecoraro@apple.com> 2 60 -
releases/WebKitGTK/webkit-2.20/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r227951 r228620 134 134 6599C5CD1EC3F15900A2F7BB /* AvailableMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 6599C5CB1EC3F15900A2F7BB /* AvailableMemory.h */; settings = {ATTRIBUTES = (Private, ); }; }; 135 135 AD0934331FCF406D00E85EB5 /* BCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = AD0934321FCF405000E85EB5 /* BCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 136 AD14AD29202529C400890E3B /* ProcessCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = AD14AD27202529A600890E3B /* ProcessCheck.h */; }; 137 AD14AD2A202529C700890E3B /* ProcessCheck.mm in Sources */ = {isa = PBXBuildFile; fileRef = AD14AD28202529B000890E3B /* ProcessCheck.mm */; }; 136 138 /* End PBXBuildFile section */ 137 139 … … 290 292 6599C5CB1EC3F15900A2F7BB /* AvailableMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AvailableMemory.h; path = bmalloc/AvailableMemory.h; sourceTree = "<group>"; }; 291 293 AD0934321FCF405000E85EB5 /* BCompiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCompiler.h; path = bmalloc/BCompiler.h; sourceTree = "<group>"; }; 294 AD14AD27202529A600890E3B /* ProcessCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProcessCheck.h; path = bmalloc/ProcessCheck.h; sourceTree = "<group>"; }; 295 AD14AD28202529B000890E3B /* ProcessCheck.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ProcessCheck.mm; path = bmalloc/ProcessCheck.mm; sourceTree = "<group>"; }; 292 296 /* End PBXFileReference section */ 293 297 … … 481 485 14105E8318E14374003A106E /* ObjectType.cpp */, 482 486 1485656018A43DBA00ED6942 /* ObjectType.h */, 487 AD14AD27202529A600890E3B /* ProcessCheck.h */, 488 AD14AD28202529B000890E3B /* ProcessCheck.mm */, 483 489 0F5BF1501F22E1570029D91D /* Scavenger.cpp */, 484 490 0F5BF1511F22E1570029D91D /* Scavenger.h */, … … 633 639 14DD78D018F48D7500950702 /* VMAllocate.h in Headers */, 634 640 0F7EB83A1F9541B000F1ABCB /* IsoDeallocatorInlines.h in Headers */, 641 AD14AD29202529C400890E3B /* ProcessCheck.h in Headers */, 635 642 1400274A18F89C2300115C97 /* VMHeap.h in Headers */, 636 643 1440AFCB1A95261100837FAA /* Zone.h in Headers */, … … 766 773 14895D911A3A319C0006235D /* Environment.cpp in Sources */, 767 774 0F7EB83F1F9541B000F1ABCB /* IsoTLSLayout.cpp in Sources */, 775 AD14AD2A202529C700890E3B /* ProcessCheck.mm in Sources */, 768 776 14F271C718EA3990008C152F /* Heap.cpp in Sources */, 769 777 0F7EB8321F9541B000F1ABCB /* IsoTLSEntry.cpp in Sources */, -
releases/WebKitGTK/webkit-2.20/Source/bmalloc/bmalloc/BPlatform.h
r226958 r228620 1 1 /* 2 * Copyright (C) 2014-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2014-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 64 64 #endif 65 65 66 #if BPLATFORM(MAC) || BPLATFORM(IOS) 67 #define BPLATFORM_COCOA 1 68 #endif 69 70 #if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH 71 #define BPLATFORM_WATCHOS 1 72 #endif 73 66 74 /* ==== Policy decision macros: these define policy choices for a particular port. ==== */ 67 75 -
releases/WebKitGTK/webkit-2.20/Source/bmalloc/bmalloc/Gigacage.cpp
r225701 r228620 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "Environment.h" 30 30 #include "PerProcess.h" 31 #include "ProcessCheck.h" 31 32 #include "VMAllocate.h" 32 33 #include "Vector.h" … … 251 252 onceFlag, 252 253 [] { 254 if (!gigacageEnabledForProcess()) 255 return; 256 253 257 bool result = !PerProcess<Environment>::get()->isDebugHeapEnabled(); 254 258 if (!result)
Note: See TracChangeset
for help on using the changeset viewer.