Bug 209806 - Silence preference write sandbox violations in the WebContent process
Summary: Silence preference write sandbox violations in the WebContent 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-03-31 06:56 PDT by Per Arne Vollan
Modified: 2020-03-31 10:28 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.37 KB, patch)
2020-03-31 06:59 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.37 KB, patch)
2020-03-31 08:09 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.46 KB, patch)
2020-03-31 09:34 PDT, 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-03-31 06:56:38 PDT
When CFPrefs direct mode is enabled in the WebContent process, the UI process will notify the WebContent about preference changes. When receiving these notifications, the WebContent process will  use the CFPrefs API to update the value of these preferences in-process, which will also attempt to write these values to disk. Writing the preference values to disk is unnecessary, and will also be denied by the sandbox, so the sandbox violations should be silenced.
Comment 1 Per Arne Vollan 2020-03-31 06:56:58 PDT
rdar://problem/60983812
Comment 2 Per Arne Vollan 2020-03-31 06:59:32 PDT
Created attachment 395033 [details]
Patch
Comment 3 Per Arne Vollan 2020-03-31 08:09:02 PDT
Created attachment 395040 [details]
Patch
Comment 4 Brent Fulgham 2020-03-31 09:25:29 PDT
Comment on attachment 395040 [details]
Patch

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

> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:878
> +    (home-prefix "/Library/Preferences/")

You might need to use:

(define (home-prefix home-relative-prefix)
    (prefix (string-append (param "HOME") home-relative-prefix)))
Comment 5 Per Arne Vollan 2020-03-31 09:34:39 PDT
Created attachment 395051 [details]
Patch
Comment 6 Per Arne Vollan 2020-03-31 09:36:11 PDT
(In reply to Brent Fulgham from comment #4)
> Comment on attachment 395040 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=395040&action=review
> 
> > Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:878
> > +    (home-prefix "/Library/Preferences/")
> 
> You might need to use:
> 
> (define (home-prefix home-relative-prefix)
>     (prefix (string-append (param "HOME") home-relative-prefix)))

I tried using 'home-subpath' in the latest patch, will that also be correct?

Thanks for reviewing!
Comment 7 Brent Fulgham 2020-03-31 10:24:13 PDT
Comment on attachment 395051 [details]
Patch

r=me
Comment 8 Per Arne Vollan 2020-03-31 10:25:20 PDT
Comment on attachment 395051 [details]
Patch

Thanks for reviewing!
Comment 9 EWS 2020-03-31 10:28:06 PDT
Committed r259297: <https://trac.webkit.org/changeset/259297>

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