Bug 218269

Summary: Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, mitz, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description Alex Christensen 2020-10-27 18:23:23 PDT
Use _CFURLConnectionSetFrameworkStubs instead of DYLD_INTERPOSE on Apple Silicon Macs
Comment 1 Alex Christensen 2020-10-27 18:32:56 PDT
Created attachment 412493 [details]
Patch
Comment 2 Darin Adler 2020-10-27 18:44:02 PDT
Comment on attachment 412493 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412493&action=review

> Source/WebKit/Shared/mac/SecItemShim.cpp:146
> -#if PLATFORM(IOS_FAMILY)
> +#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && !CPU(X86_64))

How about this instead:

    #if !CPU(X86_64)

It doesn’t seem like we need IOS_FAMILY vs. MAC here.

> Source/WebKit/Shared/mac/SecItemShim.cpp:158
> -#if PLATFORM(MAC)
> +#if PLATFORM(MAC) && CPU(X86_64)

How about this instead:

    #if CPU(X86_64)

Or:

    #else

It doesn’t seem like we need IOS_FAMILY vs. MAC here.
Comment 3 mitz 2020-10-27 18:49:23 PDT
Comment on attachment 412493 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412493&action=review

>> Source/WebKit/Shared/mac/SecItemShim.cpp:146
>> +#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && !CPU(X86_64))
> 
> How about this instead:
> 
>     #if !CPU(X86_64)
> 
> It doesn’t seem like we need IOS_FAMILY vs. MAC here.

I believe the iOS Simulator is x86_64 but doesn’t have the interposing shim.
Comment 4 Alex Christensen 2020-10-27 20:04:06 PDT
http://trac.webkit.org/r269094
Comment 5 Radar WebKit Bug Importer 2020-10-27 20:05:18 PDT
<rdar://problem/70749479>
Comment 6 Sam Weinig 2020-10-28 10:39:17 PDT
I would propose we use a more clear USE(DYLD_INTERPOSE_FOR_SEC_ITEM_SHIM) or something like that.
Comment 7 Alex Christensen 2020-10-28 21:53:16 PDT
I would propose we stop using DYLD_INTERPOSE entirely and replace it with _CFURLConnectionSetFrameworkStubs in the short term and a per-NSURLSession solution I have yet to write in the long term.  Given the nature of this radar, though, I wanted the absolute minimum risk and the easiest cherry picking to the branch.