Changeset 268796 in webkit
- Timestamp:
- Oct 21, 2020, 9:01:31 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r268793 r268796 1 2020-10-21 Alex Christensen <achristensen@webkit.org> 2 3 Don't crash when deallocating WKWebView during TLS handshake 4 https://bugs.webkit.org/show_bug.cgi?id=218025 5 <rdar://problem/70225969> 6 7 Reviewed by Tim Horton. 8 9 NetworkProcessProxy::didReceiveAuthenticationChallenge would sometimes dereference an unchecked 10 Optional<SecurityOriginData> which would result in a null dereference crash. Also, sometimes 11 Connection::initializeSendSource would assert because it was trying to set up a cancel handler for 12 a send port that had not been successfully set up yet. I added a test that reproduces both of these 13 issues most of the time. 14 15 * Platform/IPC/cocoa/ConnectionCocoa.mm: 16 (IPC::Connection::initializeSendSource): 17 * UIProcess/Network/NetworkProcessProxy.cpp: 18 (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): 19 1 20 2020-10-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
r265344 r268796 395 395 }); 396 396 397 ASSERT(MACH_PORT_VALID(m_sendPort)); 398 mach_port_t sendPort = m_sendPort; 399 dispatch_source_set_cancel_handler(m_sendSource, ^{ 400 // Release our send right. 401 deallocateSendRightSafely(sendPort); 402 }); 397 if (MACH_PORT_VALID(m_sendPort)) { 398 mach_port_t sendPort = m_sendPort; 399 dispatch_source_set_cancel_handler(m_sendSource, ^{ 400 // Release our send right. 401 deallocateSendRightSafely(sendPort); 402 }); 403 } 403 404 } 404 405 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r268458 r268796 433 433 } 434 434 435 if (!topOrigin) { 436 authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue); 437 return; 438 } 439 435 440 WebPageProxy::forMostVisibleWebPageIfAny(sessionID, *topOrigin, [this, weakThis = makeWeakPtr(this), sessionID, authenticationChallenge = WTFMove(authenticationChallenge), negotiatedLegacyTLS](auto* page) mutable { 436 441 if (!weakThis) -
trunk/Tools/ChangeLog
r268795 r268796 1 2020-10-21 Alex Christensen <achristensen@webkit.org> 2 3 Don't crash when deallocating WKWebView during TLS handshake 4 https://bugs.webkit.org/show_bug.cgi?id=218025 5 <rdar://problem/70225969> 6 7 Reviewed by Tim Horton. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 10 (TEST): 11 1 12 2020-10-20 Sam Weinig <weinig@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm
r266150 r268796 239 239 240 240 Util::run(&navigationFinished); 241 } 242 243 TEST(Challenge, DeallocateDuringChallenge) 244 { 245 using namespace TestWebKitAPI; 246 HTTPServer server({{ "/", { "hi" }}}, HTTPServer::Protocol::Https); 247 248 auto delegate = [[TestNavigationDelegate new] autorelease]; 249 delegate.didReceiveAuthenticationChallenge = ^(WKWebView *, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential *)) { 250 completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); 251 }; 252 253 @autoreleasepool { 254 Vector<RetainPtr<WKWebView>> views; 255 for (size_t i = 0; i < 100; i++) 256 views.append(adoptNS([WKWebView new])); 257 for (auto& view : views) { 258 [view setNavigationDelegate:delegate]; 259 [view loadRequest:server.request()]; 260 } 261 Util::spinRunLoop(10); 262 } 263 Util::spinRunLoop(1000); 241 264 } 242 265
Note:
See TracChangeset
for help on using the changeset viewer.