Changeset 265087 in webkit
- Timestamp:
- Jul 30, 2020 9:36:29 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r265085 r265087 1 2020-07-30 Per Arne Vollan <pvollan@apple.com> 2 3 Remember to check entitlement before communicating over XPC 4 https://bugs.webkit.org/show_bug.cgi?id=214825 5 6 Reviewed by Brent Fulgham. 7 8 Remember to check entitlement before communicating over XPC with another WebKit process. This needs to be done 9 to make sure that it really is a WebKit process on the other end. 10 11 * NetworkProcess/NetworkProcess.cpp: 12 (WebKit::m_messagePortChannelRegistry): 13 * Shared/Cocoa/XPCEndpoint.mm: 14 (WebKit::XPCEndpoint::XPCEndpoint): 15 * Shared/Cocoa/XPCEndpointClient.mm: 16 (WebKit::XPCEndpointClient::setEndpoint): 17 * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: 18 (WebKit::WebPage::platformDidReceiveLoadParameters): 19 * WebProcess/cocoa/WebProcessCocoa.mm: 20 (WebKit::WebProcess::handleXPCEndpointMessages const): 21 1 22 2020-07-30 Kate Cheney <katherine_cheney@apple.com> 2 23 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r264846 r265087 166 166 addSupplement<LegacyCustomProtocolManager>(); 167 167 #endif 168 #if PLATFORM(COCOA)168 #if HAVE(LSDATABASECONTEXT) 169 169 addSupplement<LaunchServicesDatabaseObserver>(); 170 170 #endif -
trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.mm
r264806 r265087 42 42 if (type == XPC_TYPE_CONNECTION) { 43 43 OSObjectPtr<xpc_connection_t> connection = message; 44 audit_token_t auditToken; 45 xpc_connection_get_audit_token(connection.get(), &auditToken); 44 auto pid = xpc_connection_get_pid(connection.get()); 46 45 47 if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) { 48 // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds. 49 // WTFLogAlways("Audit token does not have required entitlement"); 50 // return; 46 if (pid != getpid() && !WTF::hasEntitlement(connection.get(), "com.apple.private.webkit.use-xpc-endpoint")) { 47 WTFLogAlways("Audit token does not have required entitlement com.apple.private.webkit.use-xpc-endpoint"); 48 return; 51 49 } 52 50 xpc_connection_set_target_queue(connection.get(), dispatch_get_main_queue()); -
trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.mm
r264199 r265087 57 57 if (!connection) 58 58 return; 59 audit_token_t auditToken; 60 xpc_connection_get_audit_token(connection, &auditToken); 61 if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) { 62 // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds. 63 // WTFLogAlways("Audit token does not have required entitlement"); 64 // return; 59 60 auto pid = xpc_connection_get_pid(connection); 61 if (pid != getpid() && !WTF::hasEntitlement(connection, "com.apple.private.webkit.use-xpc-endpoint")) { 62 WTFLogAlways("Audit token does not have required entitlement com.apple.private.webkit.use-xpc-endpoint"); 63 return; 65 64 } 66 65 handleEvent(message); -
trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
r264546 r265087 65 65 void WebPage::platformDidReceiveLoadParameters(const LoadParameters& parameters) 66 66 { 67 #if HAVE(LSDATABASECONTEXT) 67 68 bool databaseUpdated = LaunchServicesDatabaseManager::singleton().waitForDatabaseUpdate(5_s); 68 69 ASSERT_UNUSED(databaseUpdated, databaseUpdated); 69 70 if (!databaseUpdated) 70 71 WTFLogAlways("Timed out waiting for Launch Services database update."); 72 #endif 71 73 72 74 m_dataDetectionContext = parameters.dataDetectionContext; -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r265081 r265087 189 189 return; 190 190 191 #if HAVE(LSDATABASECONTEXT) 191 192 if (messageName == LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointMessageName) { 192 193 auto endpoint = xpc_dictionary_get_value(event, LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointNameKey); … … 194 195 return; 195 196 } 197 #endif 196 198 }); 197 199
Note: See TracChangeset
for help on using the changeset viewer.