Unreviewed, rolling out r243008.
authortsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2019 23:49:17 +0000 (23:49 +0000)
committertsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2019 23:49:17 +0000 (23:49 +0000)
This revision broke High Sierra builders

Reverted changeset:

"[iOS] Block the accessibility server when accessibility is
not enabled."
https://bugs.webkit.org/show_bug.cgi?id=195342
https://trac.webkit.org/changeset/243008

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/spi/darwin/SandboxSPI.h
Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h
Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb
Source/WebKit/Shared/SandboxExtension.h
Source/WebKit/Shared/mac/SandboxExtensionMac.mm
Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/WebProcessProxy.cpp
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/ios/WebProcessProxyIOS.mm
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h
Source/WebKit/WebProcess/WebProcess.messages.in

index 05c85f3..73ee642 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-15  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, rolling out r243008.
+
+        This revision broke High Sierra builders
+
+        Reverted changeset:
+
+        "[iOS] Block the accessibility server when accessibility is
+        not enabled."
+        https://bugs.webkit.org/show_bug.cgi?id=195342
+        https://trac.webkit.org/changeset/243008
+
 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
 
         [iOS] Block the accessibility server when accessibility is not enabled.
index 38c390f..b2681b4 100644 (file)
@@ -63,7 +63,6 @@ extern const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT;
 
 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);
 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);
index 30d93e8..fb230bc 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-15  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, rolling out r243008.
+
+        This revision broke High Sierra builders
+
+        Reverted changeset:
+
+        "[iOS] Block the accessibility server when accessibility is
+        not enabled."
+        https://bugs.webkit.org/show_bug.cgi?id=195342
+        https://trac.webkit.org/changeset/243008
+
 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
 
         All networking from WebKit.Networking fails when Network Extension content filter is enabled
index d360f79..50ca2db 100644 (file)
@@ -41,8 +41,6 @@ WTF_EXTERN_C_BEGIN
 #if PLATFORM(IOS_FAMILY)
 extern Boolean _AXSKeyRepeatEnabled();
 extern CFTimeInterval _AXSKeyRepeatDelay();
-extern Boolean _AXSApplicationAccessibilityEnabled();
-extern CFStringRef kAXSApplicationAccessibilityEnabledNotification;
 #endif
 
 #if ENABLE(ACCESSIBILITY_EVENTS)
index c84e59f..db087e6 100644 (file)
     (global-name "com.apple.backboard.hid.focus")
     (global-name "com.apple.backboard.hid.services")
     (global-name "com.apple.iohideventsystem")
+    (global-name "com.apple.iphone.axserver-systemwide")
     (global-name "com.apple.frontboard.workspace")
     (global-name "com.apple.frontboard.systemappservices"))
 
 (deny mach-lookup (with send-signal SIGKILL)
     (global-name "com.apple.backboard.hid.services"))
 
-(allow mach-lookup (extension "com.apple.webkit.extension.mach"))
-
 ;; These services have been identified as unused during living-on.
 ;; This list overrides some definitions above and in common.sb.
 ;; FIXME: remove overridden rules once the final list has been
index 693bd70..ddfacb2 100644 (file)
@@ -27,7 +27,6 @@
 
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/ProcessID.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -47,7 +46,6 @@ public:
     enum class Type {
         ReadOnly,
         ReadWrite,
-        Mach,
         Generic,
     };
 
@@ -103,7 +101,6 @@ public:
     static bool createHandleForReadWriteDirectory(const String& path, Handle&); // Will attempt to create the directory.
     static String createHandleForTemporaryFile(const String& prefix, Type, Handle&);
     static bool createHandleForGenericExtension(const String& extensionClass, Handle&);
-    static bool createHandleForMachLookupByPid(const String& service, ProcessID, Handle&);
     ~SandboxExtension();
 
     bool consume();
index 830f39a..1f7b961 100644 (file)
@@ -40,9 +40,9 @@ namespace WebKit {
 
 class SandboxExtensionImpl {
 public:
-    static std::unique_ptr<SandboxExtensionImpl> create(const char* path, SandboxExtension::Type type, Optional<ProcessID> pid = WTF::nullopt)
+    static std::unique_ptr<SandboxExtensionImpl> create(const char* path, SandboxExtension::Type type)
     {
-        std::unique_ptr<SandboxExtensionImpl> impl { new SandboxExtensionImpl(path, type, pid) };
+        std::unique_ptr<SandboxExtensionImpl> impl { new SandboxExtensionImpl(path, type) };
         if (!impl->m_token)
             return nullptr;
         return impl;
@@ -64,10 +64,6 @@ public:
 #if PLATFORM(IOS_FAMILY_SIMULATOR)
         return !sandbox_check(getpid(), 0, SANDBOX_FILTER_NONE);
 #else
-        if (m_handle == -1) {
-            LOG_ERROR("Could not create a sandbox extension for '%s', errno = %d", m_token, errno);
-            return false;
-        }
         return m_handle;
 #endif
     }
@@ -84,22 +80,20 @@ public:
     }
 
 private:
-    char* sandboxExtensionForType(const char* path, SandboxExtension::Type type, Optional<ProcessID> pid = WTF::nullopt)
+    char* sandboxExtensionForType(const char* path, SandboxExtension::Type type)
     {
         switch (type) {
         case SandboxExtension::Type::ReadOnly:
             return sandbox_extension_issue_file(APP_SANDBOX_READ, path, 0);
         case SandboxExtension::Type::ReadWrite:
             return sandbox_extension_issue_file(APP_SANDBOX_READ_WRITE, path, 0);
-        case SandboxExtension::Type::Mach:
-            return sandbox_extension_issue_mach_to_process_by_pid("com.apple.webkit.extension.mach"_s, path, 0, pid.value());
         case SandboxExtension::Type::Generic:
             return sandbox_extension_issue_generic(path, 0);
         }
     }
 
-    SandboxExtensionImpl(const char* path, SandboxExtension::Type type, Optional<ProcessID> pid = WTF::nullopt)
-        : m_token { sandboxExtensionForType(path, type, pid) }
+    SandboxExtensionImpl(const char* path, SandboxExtension::Type type)
+        : m_token { sandboxExtensionForType(path, type) }
     {
     }
 
@@ -363,19 +357,6 @@ bool SandboxExtension::createHandleForGenericExtension(const String& extensionCl
     return true;
 }
 
-bool SandboxExtension::createHandleForMachLookupByPid(const String& service, ProcessID pid, Handle& handle)
-{
-    ASSERT(!handle.m_sandboxExtension);
-    
-    handle.m_sandboxExtension = SandboxExtensionImpl::create(service.utf8().data(), Type::Mach, pid);
-    if (!handle.m_sandboxExtension) {
-        WTFLogAlways("Could not create a '%s' sandbox extension", service.utf8().data());
-        return false;
-    }
-    
-    return true;
-}
-
 SandboxExtension::SandboxExtension(const Handle& handle)
     : m_sandboxExtension(WTFMove(handle.m_sandboxExtension))
 {
index cba1448..4514349 100644 (file)
@@ -26,7 +26,6 @@
 #import "config.h"
 #import "WebProcessPool.h"
 
-#import "AccessibilitySupportSPI.h"
 #import "CookieStorageUtilsCF.h"
 #import "LegacyCustomProtocolManagerClient.h"
 #import "NetworkProcessCreationParameters.h"
@@ -448,10 +447,6 @@ void WebProcessPool::registerNotificationObservers()
     }];
 #elif PLATFORM(IOS)
     CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, backlightLevelDidChangeCallback, static_cast<CFStringRef>(UIBacklightLevelChangedNotification), nullptr, CFNotificationSuspensionBehaviorCoalesce);
-    m_accessibilityEnabledObserver = [[NSNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXSApplicationAccessibilityEnabledNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *) {
-        for (size_t i = 0; i < m_processes.size(); ++i)
-            m_processes[i]->unblockAccessibilityServerIfNeeded();
-    }];
 #endif // !PLATFORM(IOS_FAMILY)
 }
 
@@ -471,7 +466,6 @@ void WebProcessPool::unregisterNotificationObservers()
     [[NSNotificationCenter defaultCenter] removeObserver:m_deactivationObserver.get()];
 #elif PLATFORM(IOS)
     CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, static_cast<CFStringRef>(UIBacklightLevelChangedNotification) , nullptr);
-    [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
 #endif // !PLATFORM(IOS_FAMILY)
 }
 
index 83eb0e6..6671412 100644 (file)
@@ -673,10 +673,6 @@ private:
     std::unique_ptr<PerActivityStateCPUUsageSampler> m_perActivityStateCPUUsageSampler;
 #endif
 
-#if PLATFORM(IOS_FAMILY)
-    RetainPtr<NSObject> m_accessibilityEnabledObserver;
-#endif
-
     bool m_shouldUseTestingNetworkSession { false };
 
     bool m_processTerminationEnabled { true };
index 55cd873..9030df2 100644 (file)
@@ -759,8 +759,6 @@ void WebProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connect
         if (xpc_connection_t xpcConnection = connection()->xpcConnection())
             m_throttler.didConnectToProcess(xpc_connection_get_pid(xpcConnection));
     }
-
-    unblockAccessibilityServerIfNeeded();
 #endif
 }
 
index bc3d5f1..258102b 100644 (file)
@@ -293,10 +293,6 @@ public:
     void revokeAudioCaptureExtension() { m_mediaCaptureSandboxExtensions &= ~Audio; }
 #endif
 
-#if PLATFORM(IOS_FAMILY)
-    void unblockAccessibilityServerIfNeeded();
-#endif
-
 protected:
     static uint64_t generatePageID();
     WebProcessProxy(WebProcessPool&, WebsiteDataStore&, IsPrewarmed);
@@ -435,7 +431,6 @@ private:
 #if PLATFORM(IOS_FAMILY)
     ForegroundWebProcessToken m_foregroundToken;
     BackgroundWebProcessToken m_backgroundToken;
-    bool m_hasSentMessageToUnblockAccessibilityServer { false };
 #endif
 
     HashMap<String, uint64_t> m_pageURLRetainCountMap;
index 4388087..4f92c0c 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#import "AccessibilitySupportSPI.h"
 #import "WKFullKeyboardAccessWatcher.h"
 #import "WebProcessMessages.h"
 
@@ -43,25 +42,6 @@ bool WebProcessProxy::fullKeyboardAccessEnabled()
 #endif
 }
 
-void WebProcessProxy::unblockAccessibilityServerIfNeeded()
-{
-    if (m_hasSentMessageToUnblockAccessibilityServer)
-        return;
-    if (!_AXSApplicationAccessibilityEnabled())
-        return;
-    if (!processIdentifier())
-        return;
-    if (!canSendMessage())
-        return;
-
-    SandboxExtension::Handle handle;
-    if (!SandboxExtension::createHandleForMachLookupByPid("com.apple.iphone.axserver-systemwide", processIdentifier(), handle))
-        return;
-
-    send(Messages::WebProcess::UnblockAccessibilityServer(handle), 0);
-    m_hasSentMessageToUnblockAccessibilityServer = true;
-}
-
 } // namespace WebKit
 
 #endif // PLATFORM(IOS_FAMILY)
index 9fdbc0b..d40ea81 100644 (file)
@@ -1867,12 +1867,4 @@ void WebProcess::clearCurrentModifierStateForTesting()
     PlatformKeyboardEvent::setCurrentModifierState({ });
 }
 
-#if PLATFORM(IOS_FAMILY)
-void WebProcess::unblockAccessibilityServer(const SandboxExtension::Handle& handle)
-{
-    bool ok = SandboxExtension::consumePermanently(handle);
-    ASSERT_UNUSED(ok, ok);
-}
-#endif
-
 } // namespace WebKit
index 72fe219..f17584a 100644 (file)
@@ -245,8 +245,6 @@ public:
 
 #if PLATFORM(IOS_FAMILY)
     void accessibilityProcessSuspendedNotification(bool);
-    
-    void unblockAccessibilityServer(const SandboxExtension::Handle&);
 #endif
 
 #if PLATFORM(IOS)
index 45fed46..f011b82 100644 (file)
@@ -157,8 +157,4 @@ messages -> WebProcess LegacyReceiver {
 #endif
 
     ClearCurrentModifierStateForTesting()
-
-#if PLATFORM(IOS_FAMILY)
-    UnblockAccessibilityServer(WebKit::SandboxExtension::Handle handle)
-#endif
 }