⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 269697 in webkit


Ignore:
Timestamp:
Nov 11, 2020, 12:15:07 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Alex Christensen <achristensen@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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269696 r269697  
     12020-11-11  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use _CFURLConnectionSetFrameworkStubs instead of DYLD_INTERPOSE on Intel Macs
     4        https://bugs.webkit.org/show_bug.cgi?id=218810
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        A long, long time ago, we realized that CFNetwork was looking in the keychain for persistent credentials,
     9        and in order to make the network process get credentials as the UI process, we introduced SecItemShim which
     10        used DYLD_INTERPOSE to intercept the calls to the security framework and synchronously message the UI process
     11        for those calls.  Over the last 6 years we have realized that doesn't work on iOS or Apple silicon Macs, so
     12        we use _CFURLConnectionSetFrameworkStubs instead.  That works on Intel Macs, too, and I'm reasonably certain
     13        that using it everywhere won't break anything, so as a step towards rdar://problem/15588174 which should allow
     14        us to use asynchronous messages and no more globalNetworkProcess pointer, let's stop using DYLD_INTERPOSE.
     15
     16        * Shared/mac/SecItemShim.cpp:
     17        (WebKit::initializeSecItemShim):
     18
    1192020-11-11  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebKit/Shared/mac/SecItemShim.cpp

    r269094 r269697  
    144144    globalNetworkProcess() = makeWeakPtr(process);
    145145
    146 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && !CPU(X86_64))
    147146    struct _CFNFrameworksStubs stubs = {
    148147        .version = 0,
     
    154153
    155154    _CFURLConnectionSetFrameworkStubs(&stubs);
    156 #endif
    157 
    158 #if PLATFORM(MAC) && CPU(X86_64)
    159     const SecItemShimCallbacks callbacks = {
    160         webSecItemCopyMatching,
    161         webSecItemAdd,
    162         webSecItemUpdate,
    163         webSecItemDelete
    164     };
    165    
    166     SecItemShimInitializeFunc func = reinterpret_cast<SecItemShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitSecItemShimInitialize"));
    167     func(callbacks);
    168 #endif
    169155}
    170156
Note: See TracChangeset for help on using the changeset viewer.