Title: [248731] trunk/Source
Revision
248731
Author
commit-qu...@webkit.org
Date
2019-08-15 11:02:34 -0700 (Thu, 15 Aug 2019)

Log Message

Unreviewed, rolling out r248440.
https://bugs.webkit.org/show_bug.cgi?id=200772

Introduced regressions related to loading of local files.
(Requested by perarne on #webkit).

Reverted changeset:

"[Mac] Use the PID of the WebContent process when issuing
local file read sandbox extensions"
https://bugs.webkit.org/show_bug.cgi?id=200543
https://trac.webkit.org/changeset/248440

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (248730 => 248731)


--- trunk/Source/WTF/ChangeLog	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WTF/ChangeLog	2019-08-15 18:02:34 UTC (rev 248731)
@@ -1,3 +1,18 @@
+2019-08-15  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, rolling out r248440.
+        https://bugs.webkit.org/show_bug.cgi?id=200772
+
+        Introduced regressions related to loading of local files.
+        (Requested by perarne on #webkit).
+
+        Reverted changeset:
+
+        "[Mac] Use the PID of the WebContent process when issuing
+        local file read sandbox extensions"
+        https://bugs.webkit.org/show_bug.cgi?id=200543
+        https://trac.webkit.org/changeset/248440
+
 2019-08-14  Kate Cheney  <katherine_che...@apple.com>
 
         FileSystem::deleteFile should log error status (178347)

Modified: trunk/Source/WTF/wtf/Platform.h (248730 => 248731)


--- trunk/Source/WTF/wtf/Platform.h	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WTF/wtf/Platform.h	2019-08-15 18:02:34 UTC (rev 248731)
@@ -1530,10 +1530,6 @@
 #define HAVE_SANDBOX_ISSUE_MACH_EXTENSION_TO_PROCESS_BY_PID 1
 #endif
 
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
-#define HAVE_SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_PID 1
-#endif
-
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
 #define HAVE_MDNS_FAST_REGISTRATION 1
 #endif

Modified: trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h (248730 => 248731)


--- trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h	2019-08-15 18:02:34 UTC (rev 248731)
@@ -61,7 +61,6 @@
 char *sandbox_extension_issue_file(const char *extension_class, const char *path, uint32_t flags);
 char *sandbox_extension_issue_generic(const char *extension_class, uint32_t flags);
 char *sandbox_extension_issue_mach_to_process_by_pid(const char *extension_class, const char *name, uint32_t flags, pid_t);
-char *sandbox_extension_issue_file_to_process_by_pid(const char *extension_class, const char *path, uint32_t flags, pid_t);
 int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
 int sandbox_check_by_audit_token(audit_token_t, const char *operation, enum sandbox_filter_type, ...);
 int sandbox_container_path_for_pid(pid_t, char *buffer, size_t bufsize);

Modified: trunk/Source/WebKit/ChangeLog (248730 => 248731)


--- trunk/Source/WebKit/ChangeLog	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WebKit/ChangeLog	2019-08-15 18:02:34 UTC (rev 248731)
@@ -1,3 +1,18 @@
+2019-08-15  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, rolling out r248440.
+        https://bugs.webkit.org/show_bug.cgi?id=200772
+
+        Introduced regressions related to loading of local files.
+        (Requested by perarne on #webkit).
+
+        Reverted changeset:
+
+        "[Mac] Use the PID of the WebContent process when issuing
+        local file read sandbox extensions"
+        https://bugs.webkit.org/show_bug.cgi?id=200543
+        https://trac.webkit.org/changeset/248440
+
 2019-08-15  Alex Christensen  <achristen...@webkit.org>
 
         WKUIDelegate's webView:contextMenuDidEndForElement: should be called when context menus end

Modified: trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm (248730 => 248731)


--- trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm	2019-08-15 18:02:34 UTC (rev 248731)
@@ -100,14 +100,6 @@
 #endif
         case SandboxExtension::Type::Generic:
             return sandbox_extension_issue_generic(path, 0);
-        case SandboxExtension::Type::ReadByPid:
-#if HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_PID)
-            return sandbox_extension_issue_file_to_process_by_pid(APP_SANDBOX_READ, path, 0, pid.value());
-#else
-            UNUSED_PARAM(pid);
-            ASSERT_NOT_REACHED();
-            return nullptr;
-#endif
         }
     }
 
@@ -344,19 +336,6 @@
     return true;
 }
 
-bool SandboxExtension::createHandleForReadByPid(const String& path, ProcessID pid, Handle& handle)
-{
-    ASSERT(!handle.m_sandboxExtension);
-    
-    handle.m_sandboxExtension = SandboxExtensionImpl::create(path.utf8().data(), Type::ReadByPid, pid);
-    if (!handle.m_sandboxExtension) {
-        WTFLogAlways("Could not create a '%s' sandbox extension", path.utf8().data());
-        return false;
-    }
-    
-    return true;
-}
-
 SandboxExtension::SandboxExtension(const Handle& handle)
     : m_sandboxExtension(WTFMove(handle.m_sandboxExtension))
 {

Modified: trunk/Source/WebKit/Shared/SandboxExtension.h (248730 => 248731)


--- trunk/Source/WebKit/Shared/SandboxExtension.h	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WebKit/Shared/SandboxExtension.h	2019-08-15 18:02:34 UTC (rev 248731)
@@ -49,7 +49,6 @@
         ReadWrite,
         Mach,
         Generic,
-        ReadByPid
     };
 
     class Handle {
@@ -105,7 +104,6 @@
     static String createHandleForTemporaryFile(const String& prefix, Type, Handle&);
     static bool createHandleForGenericExtension(const String& extensionClass, Handle&);
     static bool createHandleForMachLookupByPid(const String& service, ProcessID, Handle&);
-    static bool createHandleForReadByPid(const String& path, ProcessID, Handle&);
     ~SandboxExtension();
 
     bool consume();

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (248730 => 248731)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-08-15 18:01:16 UTC (rev 248730)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-08-15 18:02:34 UTC (rev 248731)
@@ -1076,11 +1076,7 @@
     // Inspector resources are in a directory with assumed access.
     ASSERT_WITH_SECURITY_IMPLICATION(!WebKit::isInspectorPage(*this));
 
-#if PLATFORM(MAC) && HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_PID)
-    if (SandboxExtension::createHandleForReadByPid("/", processIdentifier(), sandboxExtensionHandle)) {
-#else
     if (SandboxExtension::createHandle("/", SandboxExtension::Type::ReadOnly, sandboxExtensionHandle)) {
-#endif
         willAcquireUniversalFileReadSandboxExtension(process);
         return;
     }
@@ -1093,13 +1089,7 @@
     // We failed to issue an universal file read access sandbox, fall back to issuing one for the base URL instead.
     auto baseURL = URL(URL(), url.baseAsString());
     auto basePath = baseURL.fileSystemPath();
-    if (basePath.isNull())
-        return;
-#if PLATFORM(MAC) && HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_PID)
-    if (SandboxExtension::createHandleForReadByPid(basePath, processIdentifier(), sandboxExtensionHandle))
-#else
-    if (SandboxExtension::createHandle(basePath, SandboxExtension::Type::ReadOnly, sandboxExtensionHandle))
-#endif
+    if (!basePath.isNull() && SandboxExtension::createHandle(basePath, SandboxExtension::Type::ReadOnly, sandboxExtensionHandle))
         m_process->assumeReadAccessToBaseURL(*this, baseURL);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to