Bug 208033 - [iOS] Fix media related sandbox issues in the GPU Process
Summary: [iOS] Fix media related sandbox issues in the GPU Process
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-02-20 15:20 PST by Per Arne Vollan
Modified: 2020-02-26 13:11 PST (History)
6 users (show)

See Also:


Attachments
Patch (3.15 KB, patch)
2020-02-20 15:33 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.85 KB, patch)
2020-02-20 15:36 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.85 KB, patch)
2020-02-20 18:21 PST, Per Arne Vollan
eric.carlson: review+
Details | Formatted Diff | Diff
Patch (2.87 KB, patch)
2020-02-20 18:34 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-02-20 15:20:42 PST
Fix observed sandbox violations related to media playback.
Comment 1 Per Arne Vollan 2020-02-20 15:33:15 PST
Created attachment 391343 [details]
Patch
Comment 2 Per Arne Vollan 2020-02-20 15:36:38 PST
Created attachment 391346 [details]
Patch
Comment 3 Per Arne Vollan 2020-02-20 18:21:24 PST
Created attachment 391368 [details]
Patch
Comment 4 Eric Carlson 2020-02-20 18:26:52 PST
Comment on attachment 391368 [details]
Patch

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

> Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:289
> +    if (!parameters.mediaCacheDirectory.isEmpty()) {
> +        String parentFolder = parameters.mediaCacheDirectory;
> +        if ((auto position = parentFolder.reverseFind("/")) != notFound)
> +            parentFolder = parentFolder.substring(0, position);
> +        SandboxExtension::createHandleWithoutResolvingPath(parentFolder, SandboxExtension::Type::ReadWrite, parameters.mediaCacheDirectorySandboxExtensionHandle);
> +    }

Two things: 
  - I think it would be better to do this in the WebProcess, this process should just use the path provided.
  - This shouldn't be necessary at all, please file a bug about the media framework behavior.
Comment 5 Per Arne Vollan 2020-02-20 18:34:38 PST
Created attachment 391369 [details]
Patch
Comment 6 Per Arne Vollan 2020-02-20 18:35:46 PST
(In reply to Eric Carlson from comment #4)
> Comment on attachment 391368 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=391368&action=review
> 
> > Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:289
> > +    if (!parameters.mediaCacheDirectory.isEmpty()) {
> > +        String parentFolder = parameters.mediaCacheDirectory;
> > +        if ((auto position = parentFolder.reverseFind("/")) != notFound)
> > +            parentFolder = parentFolder.substring(0, position);
> > +        SandboxExtension::createHandleWithoutResolvingPath(parentFolder, SandboxExtension::Type::ReadWrite, parameters.mediaCacheDirectorySandboxExtensionHandle);
> > +    }
> 
> Two things: 
>   - I think it would be better to do this in the WebProcess, this process
> should just use the path provided.
>   - This shouldn't be necessary at all, please file a bug about the media
> framework behavior.

Thanks for reviewing! I will file a bug about the media framework behavior.
Comment 7 WebKit Commit Bot 2020-02-21 08:27:58 PST
Comment on attachment 391369 [details]
Patch

Clearing flags on attachment: 391369

Committed r257135: <https://trac.webkit.org/changeset/257135>
Comment 8 Radar WebKit Bug Importer 2020-02-26 13:11:13 PST
<rdar://problem/59818090>