Title: [269697] trunk/Source/WebKit
Revision
269697
Author
commit-qu...@webkit.org
Date
2020-11-11 12:15:07 -0800 (Wed, 11 Nov 2020)

Log Message

Use _CFURLConnectionSetFrameworkStubs instead of DYLD_INTERPOSE on Intel Macs
https://bugs.webkit.org/show_bug.cgi?id=218810

Patch by Alex Christensen <achristen...@webkit.org> on 2020-11-11
Reviewed by Geoffrey Garen.

A long, long time ago, we realized that CFNetwork was looking in the keychain for persistent credentials,
and in order to make the network process get credentials as the UI process, we introduced SecItemShim which
used DYLD_INTERPOSE to intercept the calls to the security framework and synchronously message the UI process
for those calls.  Over the last 6 years we have realized that doesn't work on iOS or Apple silicon Macs, so
we use _CFURLConnectionSetFrameworkStubs instead.  That works on Intel Macs, too, and I'm reasonably certain
that using it everywhere won't break anything, so as a step towards rdar://problem/15588174 which should allow
us to use asynchronous messages and no more globalNetworkProcess pointer, let's stop using DYLD_INTERPOSE.

* Shared/mac/SecItemShim.cpp:
(WebKit::initializeSecItemShim):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269696 => 269697)


--- trunk/Source/WebKit/ChangeLog	2020-11-11 19:57:47 UTC (rev 269696)
+++ trunk/Source/WebKit/ChangeLog	2020-11-11 20:15:07 UTC (rev 269697)
@@ -1,5 +1,23 @@
 2020-11-11  Alex Christensen  <achristen...@webkit.org>
 
+        Use _CFURLConnectionSetFrameworkStubs instead of DYLD_INTERPOSE on Intel Macs
+        https://bugs.webkit.org/show_bug.cgi?id=218810
+
+        Reviewed by Geoffrey Garen.
+
+        A long, long time ago, we realized that CFNetwork was looking in the keychain for persistent credentials,
+        and in order to make the network process get credentials as the UI process, we introduced SecItemShim which
+        used DYLD_INTERPOSE to intercept the calls to the security framework and synchronously message the UI process
+        for those calls.  Over the last 6 years we have realized that doesn't work on iOS or Apple silicon Macs, so
+        we use _CFURLConnectionSetFrameworkStubs instead.  That works on Intel Macs, too, and I'm reasonably certain
+        that using it everywhere won't break anything, so as a step towards rdar://problem/15588174 which should allow
+        us to use asynchronous messages and no more globalNetworkProcess pointer, let's stop using DYLD_INTERPOSE.
+
+        * Shared/mac/SecItemShim.cpp:
+        (WebKit::initializeSecItemShim):
+
+2020-11-11  Alex Christensen  <achristen...@webkit.org>
+
         Don't look in keychain for SecKeyRef after deserializing SecIdentityRef
         https://bugs.webkit.org/show_bug.cgi?id=218809
         <rdar://problem/69394018>

Modified: trunk/Source/WebKit/Shared/mac/SecItemShim.cpp (269696 => 269697)


--- trunk/Source/WebKit/Shared/mac/SecItemShim.cpp	2020-11-11 19:57:47 UTC (rev 269696)
+++ trunk/Source/WebKit/Shared/mac/SecItemShim.cpp	2020-11-11 20:15:07 UTC (rev 269697)
@@ -143,7 +143,6 @@
 {
     globalNetworkProcess() = makeWeakPtr(process);
 
-#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && !CPU(X86_64))
     struct _CFNFrameworksStubs stubs = {
         .version = 0,
         .SecItem_stub_CopyMatching = webSecItemCopyMatching,
@@ -153,19 +152,6 @@
     };
 
     _CFURLConnectionSetFrameworkStubs(&stubs);
-#endif
-
-#if PLATFORM(MAC) && CPU(X86_64)
-    const SecItemShimCallbacks callbacks = {
-        webSecItemCopyMatching,
-        webSecItemAdd,
-        webSecItemUpdate,
-        webSecItemDelete
-    };
-    
-    SecItemShimInitializeFunc func = reinterpret_cast<SecItemShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitSecItemShimInitialize"));
-    func(callbacks);
-#endif
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to