Diff
Modified: trunk/Source/WebKit/ChangeLog (285411 => 285412)
--- trunk/Source/WebKit/ChangeLog 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/ChangeLog 2021-11-08 18:36:12 UTC (rev 285412)
@@ -1,3 +1,32 @@
+2021-11-08 Per Arne Vollan <[email protected]>
+
+ Unify sandbox rules for diagnostic services
+ https://bugs.webkit.org/show_bug.cgi?id=232207
+ <rdar://problem/84582424>
+
+ Reviewed by Darin Adler.
+
+ In the WebContent process, we only allow access to diagnostic services for internal builds. We should do the same in all WebKit sandboxes.
+
+ * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
+ * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb:
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode const):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::platformInitializeWebProcess):
+ (WebKit::isInternalInstall): Deleted.
+ (WebKit::diagnosticServices): Deleted.
+ * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in:
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+ * WebProcess/com.apple.WebProcess.sb.in:
+
2021-11-08 Wenson Hsieh <[email protected]>
Enabling "media source inline painting" by default should work when using GPU Process for media
Modified: trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in (285411 => 285412)
--- trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in 2021-11-08 18:36:12 UTC (rev 285412)
@@ -730,13 +730,8 @@
(allow mach-lookup
(global-name "com.apple.analyticsd")
(global-name "com.apple.diagnosticd")
- )
-)
+ (global-name "com.apple.powerlog.plxpclogger.xpc")))
-(allow mach-lookup
- (global-name "com.apple.powerlog.plxpclogger.xpc")
-)
-
;; Various services required by AppKit and other frameworks
(allow mach-lookup
(global-name "com.apple.audio.audiohald")
Modified: trunk/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in (285411 => 285412)
--- trunk/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in 2021-11-08 18:36:12 UTC (rev 285412)
@@ -350,12 +350,9 @@
(global-name "com.apple.FileCoordination")
(global-name "com.apple.PowerManagement.control")
(global-name "com.apple.SystemConfiguration.configd")
- (global-name "com.apple.aggregated")
- (global-name "com.apple.analyticsd")
(global-name "com.apple.cookied")
(global-name "com.apple.cfnetwork.AuthBrokerAgent")
(global-name "com.apple.cfnetwork.cfnetworkagent")
- (global-name "com.apple.diagnosticd")
(global-name "com.apple.ist.ds.appleconnect2.service.kdctunnelcontroller")
(global-name "com.apple.logd")
(global-name "com.apple.logd.events")
@@ -366,6 +363,12 @@
(global-name "com.apple.AppSSO.service-xpc")
)
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.aggregated")
+ (global-name "com.apple.analyticsd")
+ (global-name "com.apple.diagnosticd")))
+
(allow mach-lookup (with telemetry) (global-name "com.apple.webkit.adattributiond.service"))
(allow mach-lookup (with telemetry) (global-name "org.webkit.pcmtestdaemon.service"))
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb (285411 => 285412)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb 2021-11-08 18:36:12 UTC (rev 285412)
@@ -580,9 +580,6 @@
(allow ipc-posix-shm-read* (with telemetry)
(ipc-posix-name "apple.shm.notification_center"))
-(allow mach-lookup (with telemetry)
- (global-name "com.apple.diagnosticd"))
-
(managed-configuration-read-public)
(deny system-info (with no-report)
@@ -871,9 +868,10 @@
(media-accessibility-support)
-;; Various services required by CFNetwork and other frameworks
-(allow mach-lookup (with telemetry)
- (global-name "com.apple.analyticsd"))
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.diagnosticd")
+ (global-name "com.apple.analyticsd")))
;; Silence reports about things we do not want access to:
(deny mach-lookup (with no-report)
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (285411 => 285412)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb 2021-11-08 18:36:12 UTC (rev 285412)
@@ -493,12 +493,6 @@
(allow mach-lookup (with telemetry)
(global-name "com.apple.distributed_notifications@1v3"))
-;; These are always needed in the Network process:
-(allow mach-lookup (with telemetry)
- (global-name "com.apple.diagnosticd")
- (global-name "com.apple.aggregated")
-)
-
(managed-configuration-read-public)
(allow mach-lookup (with telemetry)
@@ -642,9 +636,14 @@
;; Various services required by system frameworks
(allow mach-lookup (with telemetry)
- (global-name "com.apple.lsd.mapdb")
- (global-name "com.apple.analyticsd"))
+ (global-name "com.apple.lsd.mapdb"))
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.diagnosticd")
+ (global-name "com.apple.aggregated")
+ (global-name "com.apple.analyticsd")))
+
;; For reporting progress for active downloads <rdar://problem/44405661>
(allow mach-lookup (with telemetry)
(global-name "com.apple.ProgressReporting"))
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb (285411 => 285412)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb 2021-11-08 18:36:12 UTC (rev 285412)
@@ -235,18 +235,10 @@
(with-filter (system-attribute apple-internal)
(allow mach-lookup
(global-name
+ "com.apple.aggregated"
"com.apple.diagnosticd"
- "com.apple.system.logger"
- )
- )
-)
+ "com.apple.system.logger")))
-(deny mach-lookup (with no-report)
- (global-name
- "com.apple.aggregated"
- )
-)
-
(allow ipc-posix-shm-read*
(ipc-posix-name-prefix "apple.cfprefs."))
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in (285411 => 285412)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in 2021-11-08 18:36:12 UTC (rev 285412)
@@ -1100,6 +1100,11 @@
)
)
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.diagnosticd")
+ (global-name "com.apple.osanalytics.osanalyticshelper")))
+
(allow mach-lookup
(require-all
(extension "com.apple.webkit.extension.mach")
@@ -1107,13 +1112,11 @@
"com.apple.cfprefsd.agent"
"com.apple.cfprefsd.daemon"
"com.apple.containermanagerd"
- "com.apple.diagnosticd"
"com.apple.iphone.axserver-systemwide"
"com.apple.mobileassetd.v2"
"com.apple.mobilegestalt.xpc"
"com.apple.nehelper"
"com.apple.nesessionmanager.content-filter"
- "com.apple.osanalytics.osanalyticshelper"
"com.apple.tccd"
"com.apple.uikit.viewservice.com.apple.WebContentFilter.remoteUI"
"com.apple.webinspector"
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (285411 => 285412)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2021-11-08 18:36:12 UTC (rev 285412)
@@ -171,7 +171,6 @@
encoder << videoDecoderExtensionHandles;
#endif
- encoder << diagnosticsExtensionHandles;
#if PLATFORM(IOS_FAMILY)
encoder << dynamicMachExtensionHandles;
encoder << dynamicIOKitExtensionHandles;
@@ -491,12 +490,6 @@
parameters.videoDecoderExtensionHandles = WTFMove(*videoDecoderExtensionHandles);
#endif
- std::optional<Vector<SandboxExtension::Handle>> diagnosticsExtensionHandles;
- decoder >> diagnosticsExtensionHandles;
- if (!diagnosticsExtensionHandles)
- return false;
- parameters.diagnosticsExtensionHandles = WTFMove(*diagnosticsExtensionHandles);
-
#if PLATFORM(IOS_FAMILY)
std::optional<Vector<SandboxExtension::Handle>> dynamicMachExtensionHandles;
decoder >> dynamicMachExtensionHandles;
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (285411 => 285412)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2021-11-08 18:36:12 UTC (rev 285412)
@@ -209,7 +209,6 @@
Vector<SandboxExtension::Handle> videoDecoderExtensionHandles;
#endif
- Vector<SandboxExtension::Handle> diagnosticsExtensionHandles;
#if PLATFORM(IOS_FAMILY)
Vector<SandboxExtension::Handle> dynamicMachExtensionHandles;
Vector<SandboxExtension::Handle> dynamicIOKitExtensionHandles;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (285411 => 285412)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-11-08 18:36:12 UTC (rev 285412)
@@ -282,17 +282,7 @@
#endif
}
-static bool isInternalInstall()
-{
#if PLATFORM(IOS_FAMILY)
- static bool isInternal = MGGetBoolAnswer(kMGQAppleInternalInstallCapability);
-#else
- static bool isInternal = FileSystem::fileType("/AppleInternal") == FileSystem::FileType::Directory;
-#endif
- return isInternal;
-}
-
-#if PLATFORM(IOS_FAMILY)
static const Vector<ASCIILiteral>& nonBrowserServices()
{
ASSERT(isMainRunLoop());
@@ -306,21 +296,6 @@
}
#endif
-static const Vector<ASCIILiteral>& diagnosticServices()
-{
- ASSERT(isMainRunLoop());
- static const auto services = makeNeverDestroyed(Vector<ASCIILiteral> {
- "com.apple.diagnosticd"_s,
-#if PLATFORM(IOS_FAMILY)
- "com.apple.osanalytics.osanalyticshelper"_s
-#else
- "com.apple.analyticsd"_s,
-#endif
- });
- return services;
-}
-
-
static bool requiresContainerManagerAccess()
{
#if PLATFORM(MAC)
@@ -463,9 +438,6 @@
parameters.dynamicIOKitExtensionHandles = SandboxExtension::createHandlesForIOKitClassExtensions(WebCore::agxCompilerClasses(), std::nullopt);
#endif
- if (isInternalInstall())
- parameters.diagnosticsExtensionHandles = SandboxExtension::createHandlesForMachLookup(diagnosticServices(), std::nullopt, SandboxExtension::Flags::NoReport);
-
parameters.systemHasBattery = systemHasBattery();
parameters.systemHasAC = cachedSystemHasAC().value_or(true);
Modified: trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in (285411 => 285412)
--- trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in 2021-11-08 18:36:12 UTC (rev 285412)
@@ -333,17 +333,20 @@
(global-name "com.apple.cfprefsd.agent")
#endif
(global-name "com.apple.cookied")
- (global-name "com.apple.diagnosticd")
(global-name "com.apple.iconservices")
(global-name "com.apple.iconservices.store")
(global-name "com.apple.system.logger")
)
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.analyticsd")
+ (global-name "com.apple.diagnosticd")))
+
;; Various services required by AppKit and other frameworks
(allow mach-lookup
(global-name "com.apple.PowerManagement.control")
(global-name "com.apple.SystemConfiguration.configd")
- (global-name "com.apple.analyticsd")
(global-name "com.apple.assertiond.processassertionconnection")
(global-name "com.apple.audio.SystemSoundServer-OSX")
(global-name "com.apple.audio.audiohald")
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (285411 => 285412)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-11-08 18:36:12 UTC (rev 285412)
@@ -227,8 +227,6 @@
{
setQOS(parameters.latencyQOS, parameters.throughputQOS);
- SandboxExtension::consumePermanently(parameters.diagnosticsExtensionHandles);
-
#if HAVE(CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR)
if (canLoad_UIKit__UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor()) {
auto [overrideUserInterfaceIdiom, overrideScaleFactor] = parameters.overrideUserInterfaceIdiomAndScale;
Modified: trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in (285411 => 285412)
--- trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in 2021-11-08 18:05:22 UTC (rev 285411)
+++ trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in 2021-11-08 18:36:12 UTC (rev 285412)
@@ -1741,11 +1741,15 @@
)
#endif
+(with-filter (system-attribute apple-internal)
+ (allow mach-lookup
+ (global-name "com.apple.analyticsd")
+ (global-name "com.apple.diagnosticd")))
+
(allow mach-lookup
(require-all
(extension "com.apple.webkit.extension.mach")
(global-name
- "com.apple.analyticsd"
"com.apple.nehelper"
"com.apple.nesessionmanager.content-filter"
"com.apple.webinspector"
@@ -1753,7 +1757,6 @@
"com.apple.cfprefsd.daemon"
"com.apple.containermanagerd"
"com.apple.coreservices.launchservicesd"
- "com.apple.diagnosticd"
"com.apple.iconservices"
"com.apple.iconservices.store"
"com.apple.tccd"