Title: [289113] trunk/Source/WebKit
Revision
289113
Author
[email protected]
Date
2022-02-04 08:05:26 -0800 (Fri, 04 Feb 2022)

Log Message

[iOS][macOS] Adjust sandbox access to system-fcntl
https://bugs.webkit.org/show_bug.cgi?id=236095
<rdar://problem/88448068>

Reviewed by Brent Fulgham.

Adjust sandbox access in the WebContent process to system-fcntl based on telemetry.
This patch is blocking access to some unused fcntl commands, as well as blocking
access to fcntl commands that are only used when AppCache is enabled. This is
achieved by using sandbox state variables.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289112 => 289113)


--- trunk/Source/WebKit/ChangeLog	2022-02-04 15:47:03 UTC (rev 289112)
+++ trunk/Source/WebKit/ChangeLog	2022-02-04 16:05:26 UTC (rev 289113)
@@ -1,3 +1,19 @@
+2022-02-04  Per Arne Vollan  <[email protected]>
+
+        [iOS][macOS] Adjust sandbox access to system-fcntl
+        https://bugs.webkit.org/show_bug.cgi?id=236095
+        <rdar://problem/88448068>
+
+        Reviewed by Brent Fulgham.
+
+        Adjust sandbox access in the WebContent process to system-fcntl based on telemetry.
+        This patch is blocking access to some unused fcntl commands, as well as blocking
+        access to fcntl commands that are only used when AppCache is enabled. This is
+        achieved by using sandbox state variables.
+
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
+        * WebProcess/com.apple.WebProcess.sb.in:
+
 2022-02-03  Megan Gardner  <[email protected]>
 
         Plumb pointer type though native to web events.

Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in (289112 => 289113)


--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in	2022-02-04 15:47:03 UTC (rev 289112)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in	2022-02-04 16:05:26 UTC (rev 289113)
@@ -1377,29 +1377,28 @@
     (deny system-fcntl (with telemetry))
     (allow system-fcntl
         (fcntl-command
-            F_GETPATH)) ;; used by dyld4 and CGFontURLCreate, getcwd (at least)
-    (allow system-fcntl
-        (fcntl-command
+            F_ADDFILESIGS_RETURN ;; ImageLoaderMachO::loadCodeSignature
             F_BARRIERFSYNC
+            F_CHECK_LV ;; ImageLoaderMachO::loadCodeSignature
             F_GETCONFINED
+            F_GETFD ;; libwebrtc.dylib (no backtrace)
             F_GETFL ;; LibJPEGReadPlugin::copyImageBlockSetStandard
+            F_GETPATH ;; used by dyld4 and CGFontURLCreate, getcwd (at least)
             F_GETSIGSINFO
-            F_NOCACHE
             F_RDADVISE
             F_SETCONFINED
-            F_ADDFILESIGS_RETURN ;; ImageLoaderMachO::loadCodeSignature
-            F_CHECK_LV ;; ImageLoaderMachO::loadCodeSignature
-            F_SPECULATIVE_READ ;; ImageLoaderMachO::mapSegments
             F_SETFD ;; libwebrtc.dylib (no backtrace)
-            F_GETFD ;; libwebrtc.dylib (no backtrace)
             F_SETFL ;; CMCapture uses when camera is enabled
             F_SETNOSIGPIPE)) ;; CMCapture uses when camera is enabled
 
+    (allow system-fcntl (with telemetry-backtrace)
+        (fcntl-command
+            F_GETLK
+            F_OFD_SETLK))
+
     (define (appcache-fcntl-commands)
         (fcntl-command
-            F_GETLK
             F_OFD_GETLK
-            F_OFD_SETLK
             F_OFD_SETLKWTIMEOUT))
             
 #if HAVE(SANDBOX_STATE_FLAGS)
@@ -1411,7 +1410,7 @@
     (with-filter (require-not (state-flag "AppCacheDisabled"))
         (allow system-fcntl (appcache-fcntl-commands)))
     (with-filter (state-flag "AppCacheDisabled")
-        (allow system-fcntl (with report) (with telemetry) (appcache-fcntl-commands)))
+        (deny system-fcntl (with telemetry-backtrace) (appcache-fcntl-commands)))
 #else
     (allow system-fcntl (appcache-fcntl-commands))
 #endif

Modified: trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in (289112 => 289113)


--- trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in	2022-02-04 15:47:03 UTC (rev 289112)
+++ trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in	2022-02-04 16:05:26 UTC (rev 289113)
@@ -1817,27 +1817,19 @@
 
 (when (defined? 'system-fcntl)
     (deny system-fcntl (with telemetry))
-     (allow system-fcntl
-        (fcntl-command
-            F_GETPATH)) ;; used by dyld4 and CGFontURLCreate, getcwd (at least)
     (allow system-fcntl
        (fcntl-command
+            F_ADDFILESIGS_RETURN ;; ImageLoaderMachO::loadCodeSignature
             F_BARRIERFSYNC
+            F_CHECK_LV ;; ImageLoaderMachO::loadCodeSignature
             F_GETCONFINED
             F_GETFL ;; LibJPEGReadPlugin::copyImageBlockSetStandard
+            F_GETPATH ;; used by dyld4 and CGFontURLCreate, getcwd (at least)
             F_GETSIGSINFO
-            F_NOCACHE
-            F_RDADVISE
+            F_NOCACHE ;; Security::UnixPlusPlus::FileDesc::fcnt <- MTRegisterPluginFormatReaderBundleDirectory <- invocation function for block in WebCore::registerFormatReaderIfNecessary()
+            F_RDADVISE ;; CoreNLP::ReadOnlyFile <- +[DDScannerService scanString:range:configuration:] <- WebCore::DictionaryLookup::rangeAtHitTestResult(WebCore::HitTestResult const&)
             F_SETCONFINED
-            F_ADDFILESIGS_RETURN ;; ImageLoaderMachO::loadCodeSignature
-            F_CHECK_LV ;; ImageLoaderMachO::loadCodeSignature
-            F_SPECULATIVE_READ ;; ImageLoaderMachO::mapSegments
-            F_SETFD ;; libwebrtc.dylib (no backtrace)
-            F_GETFD ;; libwebrtc.dylib (no backtrace)
-            F_RDADVISE ;; CoreNLP::ReadOnlyFile <- +[DDScannerService scanString:range:configuration:] <- WebCore::DictionaryLookup::rangeAtHitTestResult(WebCore::HitTestResult const&)
-            F_NOCACHE ;; Security::UnixPlusPlus::FileDesc::fcnt <- MTRegisterPluginFormatReaderBundleDirectory <- invocation function for block in WebCore::registerFormatReaderIfNecessary()
-            F_SETFL ;; CMCapture uses when camera is enabled
-            F_SETNOSIGPIPE)) ;; CMCapture uses when camera is enabled
+            F_SETFD)) ;; libwebrtc.dylib (no backtrace)
 
     (define (appcache-fcntl-commands)
         (fcntl-command
@@ -1855,7 +1847,12 @@
     (with-filter (require-not (state-flag "AppCacheDisabled"))
         (allow system-fcntl (appcache-fcntl-commands)))
     (with-filter (state-flag "AppCacheDisabled")
-        (allow system-fcntl (with report) (with telemetry) (appcache-fcntl-commands)))
+        (deny system-fcntl
+            (with telemetry)
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
+            (with telemetry-backtrace)
+#endif
+            (appcache-fcntl-commands)))
 #else
     (allow system-fcntl (appcache-fcntl-commands))
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to