Bug 230516 - Move PCMDaemon to WebKit.framework and rename it to AdAttributionDaemon
Summary: Move PCMDaemon to WebKit.framework and rename it to AdAttributionDaemon
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-20 15:29 PDT by Alex Christensen
Modified: 2021-09-29 16:36 PDT (History)
3 users (show)

See Also:


Attachments
Patch (31.46 KB, patch)
2021-09-20 15:30 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (32.59 KB, patch)
2021-09-21 20:57 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (32.79 KB, patch)
2021-09-22 11:22 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (32.67 KB, patch)
2021-09-22 12:25 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-09-20 15:29:03 PDT
Move PCMDaemon to WebKit.framework and rename it to AdAttributionDaemon
Comment 1 Alex Christensen 2021-09-20 15:30:02 PDT
Created attachment 438738 [details]
Patch
Comment 2 Alex Christensen 2021-09-21 20:57:18 PDT
Created attachment 438912 [details]
Patch
Comment 3 Alex Christensen 2021-09-21 21:33:13 PDT
I verified that this does not break the internal build.
It puts the executable at /usr/local/bin/AdAttributionDaemon which we may want to change to inside the WebKit framework.
I think we will probably want to disable it somehow for Catalyst.
Comment 4 Alex Christensen 2021-09-22 11:22:50 PDT
Created attachment 438962 [details]
Patch
Comment 5 Alex Christensen 2021-09-22 11:23:31 PDT
There we go.  This one puts it in the WebKit framework similarly to how we do with our xpc service executables.
Comment 6 Tim Horton 2021-09-22 11:46:35 PDT
Comment on attachment 438962 [details]
Patch

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

> Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:690
> +(allow mach-lookup (global-name "org.webkit.pcmtestdaemon.service"))

Should the production network process have access to the test daemon?
Comment 7 Tim Horton 2021-09-22 11:46:56 PDT
(maybe instead we should grant it dynamically via SPI or something?)
Comment 8 Alex Christensen 2021-09-22 12:25:37 PDT
Created attachment 438966 [details]
Patch
Comment 9 Alex Christensen 2021-09-22 12:26:13 PDT
It apparently doesn't need it in the iOS simulator, which is where we run tests.
Comment 10 Tim Horton 2021-09-22 13:02:08 PDT
Comment on attachment 438966 [details]
Patch

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

> Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:689
> +(allow mach-lookup (global-name "com.apple.webkit.adattributiond.service"))

Needs a Per Arne or Brent review IMO
Comment 11 Brent Fulgham 2021-09-22 13:27:48 PDT
Comment on attachment 438966 [details]
Patch

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

r=me.

> Source/WebKit/ChangeLog:11
> +        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

Do we expect to run this daemon on macOS, too? Or is it only iOS at this time?

>> Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:689
>> +(allow mach-lookup (global-name "com.apple.webkit.adattributiond.service"))
> 
> Needs a Per Arne or Brent review IMO

To allow this access, we will need to do a few things:
1. Make sure the AdAttribution daemon runs as non-root.
2. AdAttribution daemon must be sandboxed.
3. We should get Product Security to review the new daemon and the IPC messages we exchange with it.

But this rule is fine for now.
Comment 12 Alex Christensen 2021-09-22 13:31:35 PDT
Comment on attachment 438966 [details]
Patch

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

>> Source/WebKit/ChangeLog:11
>> +        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
> 
> Do we expect to run this daemon on macOS, too? Or is it only iOS at this time?

Both.  I already added it to the macOS sandbox.
Comment 13 EWS 2021-09-22 14:05:58 PDT
Committed r282883 (242012@main): <https://commits.webkit.org/242012@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438966 [details].
Comment 14 Radar WebKit Bug Importer 2021-09-22 14:06:16 PDT
<rdar://problem/83416568>
Comment 15 Alex Christensen 2021-09-29 16:36:34 PDT
http://trac.webkit.org/r283281