Bug 219159 - [macOS] Issue sandbox extension to icon services when starting a drag operation
Summary: [macOS] Issue sandbox extension to icon services when starting a drag operation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-19 07:10 PST by Per Arne Vollan
Modified: 2020-11-28 04:52 PST (History)
2 users (show)

See Also:


Attachments
Patch (8.92 KB, patch)
2020-11-19 07:23 PST, Per Arne Vollan
bfulgham: review+
Details | Formatted Diff | Diff
Patch (8.94 KB, patch)
2020-11-28 03:56 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2020-11-19 07:10:53 PST
Issue sandbox extension to icon services when starting a drag operation on macOS, since the WebContent process needs access to these services when a drag is started.
Comment 1 Radar WebKit Bug Importer 2020-11-19 07:11:13 PST
<rdar://problem/71585876>
Comment 2 Per Arne Vollan 2020-11-19 07:23:04 PST
Created attachment 414578 [details]
Patch
Comment 3 Brent Fulgham 2020-11-19 15:09:39 PST
Comment on attachment 414578 [details]
Patch

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

r=me, but please make sure you revoke the extensions in the early return case.

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:2834
>      bool shouldHandleEvent = true;

I think there is an early return in the "if !(shouldHandleEvent)" case. You should probably add a revokeSandboxExtensions there, too.

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:7060
> +Vector<RefPtr<SandboxExtension>> WebPage::consumeSandboxExtensions(SandboxExtension::HandleArray&& sandboxExtensions)

We do something similar-ish in UserMediaProcessManager::revokeSandboxExtensionsIfNeeded. We might consider a future bug to consolidate the logic.
Comment 4 Per Arne Vollan 2020-11-28 03:56:38 PST
Created attachment 414976 [details]
Patch
Comment 5 Per Arne Vollan 2020-11-28 04:05:29 PST
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 414578 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=414578&action=review
> 
> r=me, but please make sure you revoke the extensions in the early return
> case.
> 
> > Source/WebKit/WebProcess/WebPage/WebPage.cpp:2834
> >      bool shouldHandleEvent = true;
> 
> I think there is an early return in the "if !(shouldHandleEvent)" case. You
> should probably add a revokeSandboxExtensions there, too.
> 

Fixed by consuming the extensions after the early return.

> > Source/WebKit/WebProcess/WebPage/WebPage.cpp:7060
> > +Vector<RefPtr<SandboxExtension>> WebPage::consumeSandboxExtensions(SandboxExtension::HandleArray&& sandboxExtensions)
> 
> We do something similar-ish in
> UserMediaProcessManager::revokeSandboxExtensionsIfNeeded. We might consider
> a future bug to consolidate the logic.

Thanks for reviewing!
Comment 6 EWS 2020-11-28 04:52:25 PST
Committed r270216: <https://trac.webkit.org/changeset/270216>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414976 [details].