<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285434] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285434">285434</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2021-11-08 14:52:36 -0800 (Mon, 08 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[macOS][GPUP] Remove sandbox read access to files
https://bugs.webkit.org/show_bug.cgi?id=232245
<rdar://problem/84617482>

Reviewed by Brent Fulgham.

Based on telemetry, remove sandbox read access to files in the GPU process on macOS.

* GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmaccomappleWebKitGPUProcesssbin">trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285433 => 285434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-11-08 22:48:17 UTC (rev 285433)
+++ trunk/Source/WebKit/ChangeLog       2021-11-08 22:52:36 UTC (rev 285434)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-11-08  Per Arne  <pvollan@apple.com>
+
+        [macOS][GPUP] Remove sandbox read access to files
+        https://bugs.webkit.org/show_bug.cgi?id=232245
+        <rdar://problem/84617482>
+
+        Reviewed by Brent Fulgham.
+
+        Based on telemetry, remove sandbox read access to files in the GPU process on macOS.
+
+        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
+
</ins><span class="cx"> 2021-11-08  Brent Fulgham  <bfulgham@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add additional mach message filter 
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmaccomappleWebKitGPUProcesssbin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in (285433 => 285434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in     2021-11-08 22:48:17 UTC (rev 285433)
+++ trunk/Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in        2021-11-08 22:52:36 UTC (rev 285434)
</span><span class="lines">@@ -46,10 +46,9 @@
</span><span class="cx">         (file-mode #o0004)
</span><span class="cx">         (subpath "/System")))
</span><span class="cx"> 
</span><del>-(allow file-read* (with telemetry)
</del><ins>+(allow file-read*
</ins><span class="cx">     (require-all (file-mode #o0004)
</span><del>-    (require-any (subpath "/Library/Filesystems/NetFSPlugins")
-    (subpath "/Library/Apple/System")
</del><ins>+    (require-any
</ins><span class="cx">     (subpath "/Library/Preferences/Logging")      ; Logging Rethink
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED < 110000
</span><span class="cx">     (subpath "/private/var/db/dyld")
</span><span class="lines">@@ -58,12 +57,6 @@
</span><span class="cx">     (subpath "/usr/lib")
</span><span class="cx">     (subpath "/usr/share"))))
</span><span class="cx"> 
</span><del>-;;; Allow reading internal profiles on development builds
-(allow file-read* (with telemetry)
-    (require-all (file-mode #o0004)
-    (subpath "/AppleInternal/Library/Preferences/Logging")
-    (system-attribute apple-internal)))
-
</del><span class="cx"> ;;; Allow mapping of system frameworks + dylibs
</span><span class="cx"> (allow file-map-executable (with telemetry)
</span><span class="cx">     (subpath "/Library/Apple/System/Library/Frameworks")
</span><span class="lines">@@ -75,23 +68,17 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> (allow file-read-metadata
</span><del>-    (literal "/var"))
-(allow file-read-metadata (with telemetry)
</del><ins>+    (literal "/var")
</ins><span class="cx">     (literal "/etc")
</span><span class="cx">     (literal "/tmp")
</span><span class="cx">     (literal "/private/etc/localtime"))
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> ;;; Allow access to standard special files.
</span><del>-(allow file-read* (with telemetry)
-    (literal "/dev/autofs_nowait")
</del><ins>+(allow file-read*
</ins><span class="cx">     (literal "/dev/random")
</span><del>-    (literal "/dev/urandom")
-    (literal "/private/etc/master.passwd")
</del><span class="cx">     (literal "/private/etc/passwd"))
</span><span class="cx"> 
</span><del>-(allow file-read*
-       file-write-data (with telemetry)
</del><ins>+(allow file-write-data (with telemetry)
</ins><span class="cx">     (literal "/dev/null")
</span><span class="cx">     (literal "/dev/zero"))
</span><span class="cx"> 
</span><span class="lines">@@ -605,30 +592,17 @@
</span><span class="cx">     *uuid-pattern*)
</span><span class="cx"> 
</span><span class="cx"> ;; Read-only preferences and data
</span><del>-(allow file-read* (with telemetry)
</del><ins>+(allow file-read*
</ins><span class="cx">     ;; Basic system paths
</span><del>-    (subpath "/Library/Dictionaries")
</del><ins>+    (subpath "/Library/Audio/Plug-Ins/HAL")
</ins><span class="cx">     (subpath "/Library/Fonts")
</span><del>-    (subpath "/Library/Frameworks")
</del><span class="cx">     (subpath "/Library/Managed Preferences")
</span><del>-    (subpath "/Library/Speech/Synthesizers")
-    (regex #"^/private/etc/(hosts|group|passwd)$")
-
-    ;; System and user preferences
-    (home-literal "/.CFUserTextEncoding")
-
</del><span class="cx">     ;; FIXME: This should be removed when <rdar://problem/8957845> is fixed.
</span><del>-    (home-subpath "/Library/Fonts")
</del><ins>+    (home-subpath "/Library/Fonts"))
</ins><span class="cx"> 
</span><del>-    (subpath "/Library/Audio/Plug-Ins/HAL")
</del><ins>+(allow file-read-data
+    (literal "/usr/local/lib/log")) ; <rdar://problem/36629495>
</ins><span class="cx"> 
</span><del>-    (home-subpath "/Library/Dictionaries"))
-
-(allow file-read-data (with telemetry)
-    (literal "/usr/local/lib/log") ; <rdar://problem/36629495>
-    ;; Needed for AES3 support
-    (subpath "/Library/Audio/Plug-Ins/Components"))
-
</del><span class="cx"> ;; Preferences support
</span><span class="cx"> (shared-preferences-read
</span><span class="cx">     "com.apple.Accessibility"
</span><span class="lines">@@ -666,10 +640,6 @@
</span><span class="cx"> ;; and to allow issuing extensions.
</span><span class="cx"> (allow-read-directory-and-issue-read-extensions (param "WEBKIT2_FRAMEWORK_DIR"))
</span><span class="cx"> 
</span><del>-;; Allow issuing extensions to system libraries that the Network process can already read.
-;; This is to avoid warnings attempting to create extensions for these resources.
-(allow-read-directory-and-issue-read-extensions "/System/Library/PrivateFrameworks/WebInspectorUI.framework")
-
</del><span class="cx"> ;; Sandbox extensions
</span><span class="cx"> (define (apply-read-and-issue-extension op path-filter)
</span><span class="cx">     (op file-read* (with telemetry) path-filter)
</span><span class="lines">@@ -776,15 +746,14 @@
</span><span class="cx">     (global-name "com.apple.SecurityServer")
</span><span class="cx">     (global-name "com.apple.ocspd"))
</span><span class="cx"> 
</span><del>-(allow file-read* (with telemetry) (subpath "/private/var/db/mds/system")) ;; FIXME: This should be removed when <rdar://problem/9538414> is fixed.
</del><ins>+(allow file-read* (subpath "/private/var/db/mds/system")) ;; FIXME: This should be removed when <rdar://problem/9538414> is fixed.
</ins><span class="cx"> (with-filter (uid 0)
</span><span class="cx">     (allow file-write* (with telemetry)
</span><span class="cx">         (subpath "/private/var/db/mds/system")) ;; FIXME: This should be removed when <rdar://problem/9538414> is fixed.
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-(allow file-read* (with telemetry)
-       (subpath "/private/var/db/mds")
-       (literal "/private/var/db/DetachedSignatures"))
</del><ins>+(allow file-read*
+    (subpath "/private/var/db/mds"))
</ins><span class="cx"> 
</span><span class="cx"> (allow ipc-posix-shm-read* ipc-posix-shm-write-data ipc-posix-shm-write-create (with telemetry)
</span><span class="cx">        (ipc-posix-name "com.apple.AppleDatabaseChanged"))
</span><span class="lines">@@ -797,8 +766,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-(allow file-read-data (with telemetry)
-    (literal "/dev/autofs_nowait")) ; Used by CF to circumvent automount triggers
</del><span class="cx"> (allow ipc-posix-shm (with telemetry)
</span><span class="cx">     (ipc-posix-name-prefix "CFPBS:")) ; <rdar://problem/13757475>
</span><span class="cx"> (allow system-fsctl (with telemetry) (fsctl-command (_IO "h" 47)))
</span><span class="lines">@@ -822,7 +789,7 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> ;; CFNetwork
</span><del>-(allow file-read-data (with telemetry) (path "/private/var/db/nsurlstoraged/dafsaData.bin"))
</del><ins>+(allow file-read-data (path "/private/var/db/nsurlstoraged/dafsaData.bin"))
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> ;; FIXME should be removed when <rdar://problem/9347205> + related radar in Safari is fixed
</span><span class="lines">@@ -853,16 +820,6 @@
</span><span class="cx">        (global-name "com.apple.coreservices.appleevents")
</span><span class="cx">        (global-name "com.apple.pasteboard.1")
</span><span class="cx">        (global-name "com.apple.speech.recognitionserver"))
</span><del>-#if PLATFORM(MAC)
-;; Also part of unnecessary NSApplication initialization, but we can't block access to these yet, see <rdar://problem/13869765>.
-(allow file-read* (with telemetry)
-       (subpath "/Library/Components")
-       (subpath "/Library/Keyboard Layouts")
-       (subpath "/Library/Input Methods")
-       (home-subpath "/Library/Components")
-       (home-subpath "/Library/Keyboard Layouts")
-       (home-subpath "/Library/Input Methods"))
-#endif
</del><span class="cx"> 
</span><span class="cx"> ;; AirPlay
</span><span class="cx"> (allow mach-lookup
</span><span class="lines">@@ -881,9 +838,6 @@
</span><span class="cx">     (global-name "com.apple.coremedia.volumecontroller.xpc")
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-;; Data Detectors
-(allow file-read* (with telemetry) (subpath "/private/var/db/datadetectors/sys"))
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> ;; Media capture, utilities
</span><span class="cx"> (if (not (defined? 'sbpl-filter?))
</span><span class="lines">@@ -933,7 +887,7 @@
</span><span class="cx"> (with-filter (extension "com.apple.webkit.camera")
</span><span class="cx">     (shared-preferences-read "com.apple.cmio")
</span><span class="cx">     (shared-preferences-read "com.apple.coremedia")
</span><del>-    (allow file-read* (with telemetry) (subpath "/Library/CoreMediaIO/Plug-Ins/DAL"))
</del><ins>+    (allow file-read* (subpath "/Library/CoreMediaIO/Plug-Ins/DAL"))
</ins><span class="cx">     (allow mach-lookup (with telemetry) (extension "com.apple.app-sandbox.mach"))
</span><span class="cx">     (allow mach-lookup (with telemetry)
</span><span class="cx">         (global-name "com.apple.cmio.AppleCameraAssistant")
</span></span></pre>
</div>
</div>

</body>
</html>