Title: [273787] branches/safari-612.1.5-branch/Source
- Revision
- 273787
- Author
- [email protected]
- Date
- 2021-03-02 19:08:22 -0800 (Tue, 02 Mar 2021)
Log Message
Cherry-pick r273270. rdar://problem/74953268
[macOS] Disabling relaunch on login for the WebContent process is racy
https://bugs.webkit.org/show_bug.cgi?id=222074
<rdar://problem/74230216>
Reviewed by Geoffrey Garen.
Source/WebCore/PAL:
Declare Launch Services key to disable relaunch on login.
* pal/spi/cocoa/LaunchServicesSPI.h:
Source/WebKit:
When NSApplication is being intialized, the method -[NSApplication disableRelaunchOnLogin] is dispatched on a non-main thread, which is in a race
with the revocation of the Launch Services sandbox extension. This patch addresses this by setting this information synchronously with Launch
Services while the sandbox extension is being held. Additionally, accessibility related code under WebPage::platformInitialize may reach out to
the Launch Services daemon once during the lifetime of the WebContent process. Make sure that call succeeds by making a synchronous call while
a sandbox extension to the Launch Services daemon is being held.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-612.1.5-branch/Source/WebCore/PAL/ChangeLog (273786 => 273787)
--- branches/safari-612.1.5-branch/Source/WebCore/PAL/ChangeLog 2021-03-03 03:08:19 UTC (rev 273786)
+++ branches/safari-612.1.5-branch/Source/WebCore/PAL/ChangeLog 2021-03-03 03:08:22 UTC (rev 273787)
@@ -1,3 +1,45 @@
+2021-03-02 Alan Coon <[email protected]>
+
+ Cherry-pick r273270. rdar://problem/74953268
+
+ [macOS] Disabling relaunch on login for the WebContent process is racy
+ https://bugs.webkit.org/show_bug.cgi?id=222074
+ <rdar://problem/74230216>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/WebCore/PAL:
+
+ Declare Launch Services key to disable relaunch on login.
+
+ * pal/spi/cocoa/LaunchServicesSPI.h:
+
+ Source/WebKit:
+
+ When NSApplication is being intialized, the method -[NSApplication disableRelaunchOnLogin] is dispatched on a non-main thread, which is in a race
+ with the revocation of the Launch Services sandbox extension. This patch addresses this by setting this information synchronously with Launch
+ Services while the sandbox extension is being held. Additionally, accessibility related code under WebPage::platformInitialize may reach out to
+ the Launch Services daemon once during the lifetime of the WebContent process. Make sure that call succeeds by making a synchronous call while
+ a sandbox extension to the Launch Services daemon is being held.
+
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-02-22 Per Arne <[email protected]>
+
+ [macOS] Disabling relaunch on login for the WebContent process is racy
+ https://bugs.webkit.org/show_bug.cgi?id=222074
+ <rdar://problem/74230216>
+
+ Reviewed by Geoffrey Garen.
+
+ Declare Launch Services key to disable relaunch on login.
+
+ * pal/spi/cocoa/LaunchServicesSPI.h:
+
2021-02-20 Chris Fleizach <[email protected]>
AX: Image should report the embedded accessibility description if available
Modified: branches/safari-612.1.5-branch/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h (273786 => 273787)
--- branches/safari-612.1.5-branch/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h 2021-03-03 03:08:19 UTC (rev 273786)
+++ branches/safari-612.1.5-branch/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h 2021-03-03 03:08:22 UTC (rev 273787)
@@ -110,6 +110,7 @@
WTF_EXTERN_C_BEGIN
extern const CFStringRef _kLSDisplayNameKey;
+extern const CFStringRef _kLSPersistenceSuppressRelaunchAtLoginKey;
LSASNRef _LSGetCurrentApplicationASN();
LSASNRef _LSCopyLSASNForAuditToken(LSSessionID, audit_token_t);
Modified: branches/safari-612.1.5-branch/Source/WebKit/ChangeLog (273786 => 273787)
--- branches/safari-612.1.5-branch/Source/WebKit/ChangeLog 2021-03-03 03:08:19 UTC (rev 273786)
+++ branches/safari-612.1.5-branch/Source/WebKit/ChangeLog 2021-03-03 03:08:22 UTC (rev 273787)
@@ -1,5 +1,52 @@
2021-03-02 Alan Coon <[email protected]>
+ Cherry-pick r273270. rdar://problem/74953268
+
+ [macOS] Disabling relaunch on login for the WebContent process is racy
+ https://bugs.webkit.org/show_bug.cgi?id=222074
+ <rdar://problem/74230216>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/WebCore/PAL:
+
+ Declare Launch Services key to disable relaunch on login.
+
+ * pal/spi/cocoa/LaunchServicesSPI.h:
+
+ Source/WebKit:
+
+ When NSApplication is being intialized, the method -[NSApplication disableRelaunchOnLogin] is dispatched on a non-main thread, which is in a race
+ with the revocation of the Launch Services sandbox extension. This patch addresses this by setting this information synchronously with Launch
+ Services while the sandbox extension is being held. Additionally, accessibility related code under WebPage::platformInitialize may reach out to
+ the Launch Services daemon once during the lifetime of the WebContent process. Make sure that call succeeds by making a synchronous call while
+ a sandbox extension to the Launch Services daemon is being held.
+
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-02-22 Per Arne <[email protected]>
+
+ [macOS] Disabling relaunch on login for the WebContent process is racy
+ https://bugs.webkit.org/show_bug.cgi?id=222074
+ <rdar://problem/74230216>
+
+ Reviewed by Geoffrey Garen.
+
+ When NSApplication is being intialized, the method -[NSApplication disableRelaunchOnLogin] is dispatched on a non-main thread, which is in a race
+ with the revocation of the Launch Services sandbox extension. This patch addresses this by setting this information synchronously with Launch
+ Services while the sandbox extension is being held. Additionally, accessibility related code under WebPage::platformInitialize may reach out to
+ the Launch Services daemon once during the lifetime of the WebContent process. Make sure that call succeeds by making a synchronous call while
+ a sandbox extension to the Launch Services daemon is being held.
+
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
+2021-03-02 Alan Coon <[email protected]>
+
Cherry-pick r273265. rdar://problem/74953476
UserMediaPermissionRequestManagerProxy may be released while computing capture device list
Modified: branches/safari-612.1.5-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (273786 => 273787)
--- branches/safari-612.1.5-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-03-03 03:08:19 UTC (rev 273786)
+++ branches/safari-612.1.5-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-03-03 03:08:22 UTC (rev 273787)
@@ -329,6 +329,15 @@
updateProcessName(IsInProcessInitialization::Yes);
#if ENABLE(SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS)
+ // Disable relaunch on login. This is also done from -[NSApplication init] by dispatching -[NSApplication disableRelaunchOnLogin] on a non-main thread.
+ // This will be in a race with the closing of the Launch Services connection, so call it synchronously here.
+ // The cost of calling this should be small, and it is not expected to have any impact on performance.
+ _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSPersistenceSuppressRelaunchAtLoginKey, kCFBooleanTrue, nullptr);
+
+ // This is being called under WebPage::platformInitialize(), and may reach out to the Launch Services daemon once in the lifetime of the process.
+ // Call this synchronously here while a sandbox extension to Launch Services is being held.
+ [NSAccessibilityRemoteUIElement remoteTokenForLocalUIElement:adoptNS([[WKAccessibilityWebPageObject alloc] init]).get()];
+
auto method = class_getInstanceMethod([NSApplication class], @selector(_updateCanQuitQuietlyAndSafely));
method_setImplementation(method, (IMP)preventAppKitFromContactingLaunchServices);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes