Bug 220595 - [GPUP][iOS] Create sandbox extensions for cache and temp directory
Summary: [GPUP][iOS] Create sandbox extensions for cache and temp directory
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: 2021-01-13 09:53 PST by Per Arne Vollan
Modified: 2021-01-14 07:31 PST (History)
7 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2021-01-13 09:57 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (5.14 KB, patch)
2021-01-13 10:43 PST, Per Arne Vollan
cdumez: review+
Details | Formatted Diff | Diff
Patch (6.51 KB, patch)
2021-01-13 14:10 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (7.25 KB, patch)
2021-01-14 06:02 PST, Per Arne Vollan
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (7.32 KB, patch)
2021-01-14 06:25 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 2021-01-13 09:53:02 PST
Create sandbox extensions for GPU process access to cache and temp directory.
Comment 1 Per Arne Vollan 2021-01-13 09:53:46 PST
<rdar://problem/72450307>
Comment 2 Per Arne Vollan 2021-01-13 09:57:07 PST
Created attachment 417544 [details]
Patch
Comment 3 Simon Fraser (smfr) 2021-01-13 10:01:16 PST
Comment on attachment 417544 [details]
Patch

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

> Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> +#if PLATFORM(IOS_FAMILY)
> +    encoder << containerCachesDirectoryExtensionHandle;
> +    encoder << containerTemporaryDirectoryExtensionHandle;
> +#endif

Why is this iOS only?
Comment 4 Chris Dumez 2021-01-13 10:03:16 PST
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 417544 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417544&action=review
> 
> > Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> > +#if PLATFORM(IOS_FAMILY)
> > +    encoder << containerCachesDirectoryExtensionHandle;
> > +    encoder << containerTemporaryDirectoryExtensionHandle;
> > +#endif
> 
> Why is this iOS only?

When GPUProcess is disabled and we pass those to the WebProcess, the code is for IOS_FAMILY only too, so at least it is consistent.

The patch does not build on iOS EWS though.
Comment 5 Per Arne Vollan 2021-01-13 10:43:14 PST
Created attachment 417547 [details]
Patch
Comment 6 Per Arne Vollan 2021-01-13 10:54:32 PST
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 417544 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417544&action=review
> 
> > Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> > +#if PLATFORM(IOS_FAMILY)
> > +    encoder << containerCachesDirectoryExtensionHandle;
> > +    encoder << containerTemporaryDirectoryExtensionHandle;
> > +#endif
> 
> Why is this iOS only?

This works a little different on macOS, where confstr is used in the UI process to determine the cache and temp directory. The cache and temp directories are then passed as sandbox parameters, and sandbox rules will allow access to these directories.

Thanks for reviewing!
Comment 7 Per Arne Vollan 2021-01-13 10:55:08 PST
(In reply to Chris Dumez from comment #4)
> (In reply to Simon Fraser (smfr) from comment #3)
> > Comment on attachment 417544 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=417544&action=review
> > 
> > > Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> > > +#if PLATFORM(IOS_FAMILY)
> > > +    encoder << containerCachesDirectoryExtensionHandle;
> > > +    encoder << containerTemporaryDirectoryExtensionHandle;
> > > +#endif
> > 
> > Why is this iOS only?
> 
> When GPUProcess is disabled and we pass those to the WebProcess, the code is
> for IOS_FAMILY only too, so at least it is consistent.
> 
> The patch does not build on iOS EWS though.

Should be fixed in latest patch.

Thanks for reviewing!
Comment 8 Simon Fraser (smfr) 2021-01-13 11:03:25 PST
(In reply to Per Arne Vollan from comment #6)
> (In reply to Simon Fraser (smfr) from comment #3)
> > Comment on attachment 417544 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=417544&action=review
> > 
> > > Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> > > +#if PLATFORM(IOS_FAMILY)
> > > +    encoder << containerCachesDirectoryExtensionHandle;
> > > +    encoder << containerTemporaryDirectoryExtensionHandle;
> > > +#endif
> > 
> > Why is this iOS only?
> 
> This works a little different on macOS, where confstr is used in the UI
> process to determine the cache and temp directory. The cache and temp
> directories are then passed as sandbox parameters, and sandbox rules will
> allow access to these directories.

It would be nicer to use a HAVE_FOO or USE_FOO macro then. We should avoid sprinkling platform #ifdefs around.
Comment 9 Per Arne Vollan 2021-01-13 11:11:22 PST
(In reply to Simon Fraser (smfr) from comment #8)
> (In reply to Per Arne Vollan from comment #6)
> > (In reply to Simon Fraser (smfr) from comment #3)
> > > Comment on attachment 417544 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=417544&action=review
> > > 
> > > > Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:57
> > > > +#if PLATFORM(IOS_FAMILY)
> > > > +    encoder << containerCachesDirectoryExtensionHandle;
> > > > +    encoder << containerTemporaryDirectoryExtensionHandle;
> > > > +#endif
> > > 
> > > Why is this iOS only?
> > 
> > This works a little different on macOS, where confstr is used in the UI
> > process to determine the cache and temp directory. The cache and temp
> > directories are then passed as sandbox parameters, and sandbox rules will
> > allow access to these directories.
> 
> It would be nicer to use a HAVE_FOO or USE_FOO macro then. We should avoid
> sprinkling platform #ifdefs around.

Sounds good, I will use a USE macro!
Comment 10 Per Arne Vollan 2021-01-13 14:10:32 PST
Created attachment 417564 [details]
Patch
Comment 11 Per Arne Vollan 2021-01-14 06:02:37 PST
Created attachment 417612 [details]
Patch
Comment 12 Per Arne Vollan 2021-01-14 06:25:46 PST
Created attachment 417614 [details]
Patch
Comment 13 EWS 2021-01-14 07:31:23 PST
Committed r271482: <https://trac.webkit.org/changeset/271482>

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