Bug 209806

Summary: Silence preference write sandbox violations in the WebContent process
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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].