Title: [262004] trunk/Source/WebKit
Revision
262004
Author
cdu...@apple.com
Date
2020-05-21 09:08:50 -0700 (Thu, 21 May 2020)

Log Message

[WK2] WebKit abandons compiled sandbox profiles
https://bugs.webkit.org/show_bug.cgi?id=212177
<rdar://problem/54613619>

Reviewed by Saam Barati.

WebKit generates new compiled sandbox profiles whenever sandbox profiles are updated or
whenever webkit directories change (which is super common for WebKitTestRunner). Previous
compiled sandbox profiles do not get deleted and therefore may accumulate.

To address the issue, we now save compiled sandbox profiles under _CS_DARWIN_USER_TEMP_DIR
instead of _CS_DARWIN_USER_CACHE_DIR. The system takes care of deleting the files under
_CS_DARWIN_USER_TEMP_DIR upon reboot or if they have not been accessed for 3 days.

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::sandboxDataVaultParentDirectory):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (262003 => 262004)


--- trunk/Source/WebKit/ChangeLog	2020-05-21 16:04:12 UTC (rev 262003)
+++ trunk/Source/WebKit/ChangeLog	2020-05-21 16:08:50 UTC (rev 262004)
@@ -1,3 +1,22 @@
+2020-05-21  Chris Dumez  <cdu...@apple.com>
+
+        [WK2] WebKit abandons compiled sandbox profiles
+        https://bugs.webkit.org/show_bug.cgi?id=212177
+        <rdar://problem/54613619>
+
+        Reviewed by Saam Barati.
+
+        WebKit generates new compiled sandbox profiles whenever sandbox profiles are updated or
+        whenever webkit directories change (which is super common for WebKitTestRunner). Previous
+        compiled sandbox profiles do not get deleted and therefore may accumulate.
+
+        To address the issue, we now save compiled sandbox profiles under _CS_DARWIN_USER_TEMP_DIR
+        instead of _CS_DARWIN_USER_CACHE_DIR. The system takes care of deleting the files under
+        _CS_DARWIN_USER_TEMP_DIR upon reboot or if they have not been accessed for 3 days.
+
+        * Shared/mac/AuxiliaryProcessMac.mm:
+        (WebKit::sandboxDataVaultParentDirectory):
+
 2020-05-21  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Unreviewed, fix the iOS 13.4 build after r261978

Modified: trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm (262003 => 262004)


--- trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm	2020-05-21 16:04:12 UTC (rev 262003)
+++ trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm	2020-05-21 16:08:50 UTC (rev 262004)
@@ -256,7 +256,10 @@
 static String sandboxDataVaultParentDirectory()
 {
     char temp[PATH_MAX];
-    size_t length = confstr(_CS_DARWIN_USER_CACHE_DIR, temp, sizeof(temp));
+    // We save the profiles in the user tempory directory so that they get cleaned on reboot
+    // or if they are not accessed in 3 days. This avoids accumulating profiles whenever we change
+    // our sandbox rules or webkit cache directories (rdar://problem/54613619).
+    size_t length = confstr(_CS_DARWIN_USER_TEMP_DIR, temp, sizeof(temp));
     if (!length) {
         WTFLogAlways("%s: Could not retrieve user cache directory path: %s\n", getprogname(), strerror(errno));
         exit(EX_NOPERM);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to