Title: [290288] trunk/Source/WebKit
Revision
290288
Author
[email protected]
Date
2022-02-21 20:57:51 -0800 (Mon, 21 Feb 2022)

Log Message

Allow adattributiond to start on iOS devices
https://bugs.webkit.org/show_bug.cgi?id=237009
<rdar://89062166>

Reviewed by Per Arne Vollan.

There were three more problems preventing it from starting:
1. The code signature said to look for a sandbox profile with "webkit" in the name, but the profile had "WebKit" in the name.
   These names are case sensitive.
2. The sandbox profile would not let it load the WebKit framework, so dyld would fail and the process would fail to launch.
   I added the framework directories that the XPC services are allowed to access.
3. Once it started, it would crash inside WTF::initializeMainThread when calling WTF::pageSize which requires access to the hw.pagesize_compat syscall.
   As a starting point, I'm going to allow all the syscalls that the network process currently has access to,
   which is enough to get it to respond without crashing.
4. We need access to com.apple.diagnosticd and com.apple.analyticsd in order to be able to generate crash reports.  This is quite useful.
Yes, I know I said there were only three problems, but the 4th is so useful I thought I'd put it in the list.

* Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb:
* Scripts/process-entitlements.sh:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (290287 => 290288)


--- trunk/Source/WebKit/ChangeLog	2022-02-22 04:57:01 UTC (rev 290287)
+++ trunk/Source/WebKit/ChangeLog	2022-02-22 04:57:51 UTC (rev 290288)
@@ -1,5 +1,27 @@
 2022-02-21  Alex Christensen  <[email protected]>
 
+        Allow adattributiond to start on iOS devices
+        https://bugs.webkit.org/show_bug.cgi?id=237009
+        <rdar://89062166>
+
+        Reviewed by Per Arne Vollan.
+
+        There were three more problems preventing it from starting:
+        1. The code signature said to look for a sandbox profile with "webkit" in the name, but the profile had "WebKit" in the name.
+           These names are case sensitive.
+        2. The sandbox profile would not let it load the WebKit framework, so dyld would fail and the process would fail to launch.
+           I added the framework directories that the XPC services are allowed to access.
+        3. Once it started, it would crash inside WTF::initializeMainThread when calling WTF::pageSize which requires access to the hw.pagesize_compat syscall.
+           As a starting point, I'm going to allow all the syscalls that the network process currently has access to,
+           which is enough to get it to respond without crashing.
+        4. We need access to com.apple.diagnosticd and com.apple.analyticsd in order to be able to generate crash reports.  This is quite useful.
+        Yes, I know I said there were only three problems, but the 4th is so useful I thought I'd put it in the list.
+
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb:
+        * Scripts/process-entitlements.sh:
+
+2022-02-21  Alex Christensen  <[email protected]>
+
         Improve const correctness for SecurityOrigin accessors
         https://bugs.webkit.org/show_bug.cgi?id=236983
 

Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb (290287 => 290288)


--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb	2022-02-22 04:57:01 UTC (rev 290287)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb	2022-02-22 04:57:51 UTC (rev 290288)
@@ -73,6 +73,37 @@
 (allow file-read* file-write*
     (subpath "/var/mobile/Library/com.apple.webkit.addattributiond"))
 
+(allow file-read* file-map-executable
+    (subpath "/System/Library/Frameworks")
+    (subpath "/System/Library/PrivateFrameworks"))
+
+(with-filter (system-attribute apple-internal)
+    (allow mach-lookup
+        (global-name "com.apple.analyticsd")
+        (global-name "com.apple.diagnosticd")))
+
+(deny sysctl* (with telemetry))
+(allow sysctl-read
+    (sysctl-name
+        "hw.activecpu"
+        "hw.machine"
+        "hw.memsize"
+        "hw.ncpu"
+        "hw.pagesize_compat"
+        "kern.bootargs"
+        "kern.hostname"
+        "kern.maxfilesperproc"
+        "kern.osproductversion"
+        "kern.osrelease"
+        "kern.ostype"
+        "kern.osvariant_status"
+        "kern.osversion"
+        "kern.secure_kernel"
+        "kern.version"
+        "vm.footprint_suspend")
+    (sysctl-name-prefix "kern.proc.pid.")
+)
+
 (allow-read-write-directory-contents (param "DARWIN_USER_CACHE_DIR"))
 (allow-read-write-directory-contents (param "DARWIN_USER_TEMP_DIR"))
 

Modified: trunk/Source/WebKit/Scripts/process-entitlements.sh (290287 => 290288)


--- trunk/Source/WebKit/Scripts/process-entitlements.sh	2022-02-22 04:57:01 UTC (rev 290287)
+++ trunk/Source/WebKit/Scripts/process-entitlements.sh	2022-02-22 04:57:51 UTC (rev 290288)
@@ -510,7 +510,7 @@
 function ios_family_process_adattributiond_entitlements()
 {
     plistbuddy Add :seatbelt-profiles array
-    plistbuddy Add :seatbelt-profiles:0 string com.apple.webkit.adattributiond
+    plistbuddy Add :seatbelt-profiles:0 string com.apple.WebKit.adattributiond
 }
 
 function ios_family_process_webpushd_entitlements()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to