Changeset 263570 in webkit
- Timestamp:
- Jun 26, 2020 10:37:25 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r263568 r263570 1 2020-06-26 Chris Dumez <cdumez@apple.com> 2 3 [iOS] Network process is crashing when launching TJMaxx app due to invalid NetworkProcess::DestroySession IPC message 4 https://bugs.webkit.org/show_bug.cgi?id=213625 5 <rdar://problem/64737890> 6 7 Reviewed by Alex Christensen. 8 9 The app is calling [WKWebsiteDataStore init] despite the method being marked as unavailable in 10 WKWebsiteDataStore.h. As a result, they end up with a WKWebsiteDataStore object whose internal 11 _websiteDataStore is bad because its constructor was never called. When [WKWebsiteDataStore dealloc] 12 gets called later own, it calls the ~WebsiteDataStore() destructor for _websiteDataStore but its 13 m_sessionID is 0 because we never called the constructor. This causes us to send a 14 NetworkProcess::DestroySession IPC with a sessionID that is 0, which is not valid so the 15 NetworkProcess crashes. 16 17 To address the issue, we now provide an implementation of [WKWebsiteDataStore init] which raises an 18 exception, behind a linked-on-after check. To keep the app working, [WKWebsiteDataStore init] returns 19 a new ephemeral data store until rebuilt with the new SDK. 20 21 * UIProcess/API/Cocoa/WKWebsiteDataStore.h: 22 Mark "new" as unavailable, otherwise [WKWebsiteDataStore new] builds. 23 24 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: 25 (-[WKWebsiteDataStore init]): 26 Raise an exception with latest SDK, a new ephemeral data store otherwise. 27 28 * UIProcess/Cocoa/VersionChecks.h: 29 Add linked-on-after check. 30 31 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 32 (WebKit::WebsiteDataStore::~WebsiteDataStore): 33 Add a release assertion to make sure that m_sessionID is always valid when the destructor is called. 34 1 35 2020-06-26 Stephan Szabo <stephan.szabo@sony.com> 2 36 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h
r263547 r263570 48 48 + (WKWebsiteDataStore *)nonPersistentDataStore; 49 49 50 - (instancetype)new NS_UNAVAILABLE; 50 51 - (instancetype)init NS_UNAVAILABLE; 51 52 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
r263547 r263570 31 31 #import "CompletionHandlerCallChecker.h" 32 32 #import "ShouldGrandfatherStatistics.h" 33 #import "VersionChecks.h" 33 34 #import "WKHTTPCookieStoreInternal.h" 34 35 #import "WKNSArray.h" … … 116 117 } 117 118 119 - (instancetype)init 120 { 121 if (WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstWithWKWebsiteDataStoreInitReturningNil)) 122 [NSException raise:NSGenericException format:@"Calling [WKWebsiteDataStore init] is not supported."]; 123 124 if (!(self = [super init])) 125 return nil; 126 127 RELEASE_LOG_ERROR(Storage, "Application is calling [WKWebsiteDataStore init], which is not supported"); 128 API::Object::constructInWrapper<WebKit::WebsiteDataStore>(self, WebKit::WebsiteDataStoreConfiguration::create(WebKit::IsPersistent::No), PAL::SessionID::generateEphemeralSessionID()); 129 130 return self; 131 } 132 118 133 - (void)dealloc 119 134 { -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r263547 r263570 95 95 FirstThatSendsNativeMouseEvents = DYLD_IOS_VERSION_13_4, 96 96 FirstWithInitializeWebKit2MainThreadAssertion = DYLD_IOS_VERSION_14_0, 97 FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_IOS_VERSION_14_0, 97 98 #elif PLATFORM(MAC) 98 99 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, … … 108 109 FirstWithSessionCleanupByDefault = DYLD_MACOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT, 109 110 FirstWithInitializeWebKit2MainThreadAssertion = DYLD_MACOSX_VERSION_10_16, 111 FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_MACOSX_VERSION_10_16, 110 112 #endif 111 113 }; -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r263568 r263570 125 125 { 126 126 ASSERT(RunLoop::isMain()); 127 RELEASE_ASSERT(m_sessionID.isValid()); 127 128 128 129 platformDestroy();
Note: See TracChangeset
for help on using the changeset viewer.