RESOLVED FIXED 192670
[macOS] Block coreservicesd in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=192670
Summary [macOS] Block coreservicesd in sandbox.
Per Arne Vollan
Reported 2018-12-13 11:39:48 PST
We should block CoreServices in newer versions of macOS.
Attachments
Patch (3.57 KB, patch)
2018-12-13 11:45 PST, Per Arne Vollan
no flags
Patch (4.05 KB, patch)
2019-01-16 10:13 PST, Per Arne Vollan
no flags
Patch (4.15 KB, patch)
2019-01-16 10:42 PST, Per Arne Vollan
no flags
Patch (4.18 KB, patch)
2019-02-07 10:23 PST, Per Arne Vollan
no flags
Patch (5.21 KB, patch)
2019-02-07 13:07 PST, Per Arne Vollan
no flags
Patch (5.21 KB, patch)
2019-02-07 13:27 PST, Per Arne Vollan
no flags
Patch (5.22 KB, patch)
2019-02-07 14:54 PST, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2018-12-13 11:45:29 PST
Per Arne Vollan
Comment 2 2018-12-13 11:49:46 PST
This patch stops blocking CoreServices on Mojave, since this caused a performance regression.
Geoffrey Garen
Comment 3 2018-12-14 16:32:47 PST
Comment on attachment 357240 [details] Patch This looks like the right way to restore coreservicesd sandboxing. But we probably shouldn't do that until we fix the _CSCheckFix performance issue.
Geoffrey Garen
Comment 4 2018-12-14 16:44:24 PST
...Also we need to make sure that denying access to coreservicesd does not prevent us from setting our process name in Activity Monitor.
Per Arne Vollan
Comment 5 2018-12-14 17:08:01 PST
(In reply to Geoffrey Garen from comment #4) > ...Also we need to make sure that denying access to coreservicesd does not > prevent us from setting our process name in Activity Monitor. That's a good point. I believe this should work, since we were able to set the url of the WebContent process in Activity Monitor also before _RegisterApplication was moved to be called before entering the sandbox.
Per Arne Vollan
Comment 6 2019-01-16 10:13:26 PST
Per Arne Vollan
Comment 7 2019-01-16 10:42:53 PST
EWS Watchlist
Comment 8 2019-01-16 10:44:46 PST
Attachment 359280 [details] did not pass style-queue: ERROR: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:104: Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file. [build/version_check] [5] ERROR: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:218: Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file. [build/version_check] [5] Total errors found: 2 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 9 2019-01-16 11:55:53 PST
Comment on attachment 359280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359280&action=review r=me > Source/WebKit/Shared/ChildProcess.cpp:77 > + initializeProcessName(parameters); Can you manually verify that WebContent process names still show up in Activity Monitor correctly? They should appear either as "http://example.com" for one page per process, "http://example.com, ..." for multiple pages per process, or "Safari WebContent (Prewarmed)" for the prewarmed PSON process.
Per Arne Vollan
Comment 10 2019-01-16 12:06:10 PST
(In reply to Geoffrey Garen from comment #9) > Comment on attachment 359280 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359280&action=review > > r=me > > > Source/WebKit/Shared/ChildProcess.cpp:77 > > + initializeProcessName(parameters); > > Can you manually verify that WebContent process names still show up in > Activity Monitor correctly? They should appear either as > "http://example.com" for one page per process, "http://example.com, ..." for > multiple pages per process, or "Safari WebContent (Prewarmed)" for the > prewarmed PSON process. Yes, manually verified that this still works :) Thanks for reviewing!
Aakash Jain
Comment 11 2019-01-17 05:00:54 PST
> Created attachment 359280 [details] This patch seems to cause following API Tests issues: Failure: TestWebKitAPI.ProcessSwap.SessionStorage Timeout: TestWebKitAPI.WKNavigation.FailureToStartWebProcessRecovery Crash: TestWebKitAPI.WebKit.OverrideLayoutSizeIsRestoredAfterChangingDuringProcessRelaunch TestWebKitAPI.WebKit.OverrideLayoutSizeIsRestoredAfterProcessRelaunch TestWebKitAPI.WebKit.DoAfterNextPresentationUpdateAfterCrash TestWebKitAPI.WebKit.InteractionDeadlockAfterCrash TestWebKitAPI.WKNavigation.FailureToStartWebProcessAfterCrashRecovery TestWebKitAPI.WebKit.DoAfterNextStablePresentationUpdateAfterCrash Build: https://ews-build.webkit-uat.org/#/builders/20/builds/176 We are doing test-runs for upcoming 'EWS for API tests'. If this is a false positive, please let us know.
Aakash Jain
Comment 12 2019-01-17 05:05:11 PST
on macOS, this patch seems to cause following API Tests issues: Timeout: TestWebKitAPI.WKNavigation.FailureToStartWebProcessRecovery Crash: TestWebKitAPI.WebKit.ResizeWindowAfterCrash TestWebKitAPI.WebKit.ReloadPageAfterCrash TestWebKitAPI.WebKit.EnumerateDevices TestWebKitAPI.WKNavigation.FailureToStartWebProcessAfterCrashRecovery TestWebKitAPI.WebKit.LoadPageAfterCrash Build: https://ews-build.webkit-uat.org/#/builders/19/builds/311 We are doing test-runs for upcoming 'EWS for API tests'. If this is a false positive, please let us know.
Brent Fulgham
Comment 13 2019-01-24 10:38:16 PST
Per Arne Vollan
Comment 14 2019-02-07 10:18:01 PST
(In reply to Aakash Jain from comment #12) > on macOS, this patch seems to cause following API Tests issues: > > Timeout: TestWebKitAPI.WKNavigation.FailureToStartWebProcessRecovery > Crash: > TestWebKitAPI.WebKit.ResizeWindowAfterCrash > TestWebKitAPI.WebKit.ReloadPageAfterCrash > TestWebKitAPI.WebKit.EnumerateDevices > TestWebKitAPI.WKNavigation.FailureToStartWebProcessAfterCrashRecovery > TestWebKitAPI.WebKit.LoadPageAfterCrash > > > Build: https://ews-build.webkit-uat.org/#/builders/19/builds/311 > > We are doing test-runs for upcoming 'EWS for API tests'. If this is a false > positive, please let us know. I don't see these failures on my local build.
Per Arne Vollan
Comment 15 2019-02-07 10:23:52 PST
EWS Watchlist
Comment 16 2019-02-07 10:24:56 PST
Attachment 361411 [details] did not pass style-queue: ERROR: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:104: Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file. [build/version_check] [5] ERROR: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:218: Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file. [build/version_check] [5] Total errors found: 2 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Aakash Jain
Comment 17 2019-02-07 11:03:03 PST
> I don't see these failures on my local build. It might be false positive then.
Alexey Proskuryakov
Comment 18 2019-02-07 11:30:26 PST
Comment on attachment 361411 [details] Patch Please address the style checker error.
Per Arne Vollan
Comment 19 2019-02-07 13:07:33 PST
Per Arne Vollan
Comment 20 2019-02-07 13:11:04 PST
(In reply to Alexey Proskuryakov from comment #18) > Comment on attachment 361411 [details] > Patch > > Please address the style checker error. Thanks Alexey! Uploaded new patch to address the style error.
Alexey Proskuryakov
Comment 21 2019-02-07 13:22:05 PST
Comment on attachment 361431 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361431&action=review > Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:644 > +#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 Can't we use HAVE(CSCHECKFIXDISABLE) here?
Per Arne Vollan
Comment 22 2019-02-07 13:27:25 PST
Per Arne Vollan
Comment 23 2019-02-07 13:28:22 PST
(In reply to Alexey Proskuryakov from comment #21) > Comment on attachment 361431 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361431&action=review > > > Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:644 > > +#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 > > Can't we use HAVE(CSCHECKFIXDISABLE) here? I don't think we can use these macros in the sandbox .in file.
Alexey Proskuryakov
Comment 24 2019-02-07 14:34:21 PST
Comment on attachment 361431 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361431&action=review >>> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:644 >>> +#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 >> >> Can't we use HAVE(CSCHECKFIXDISABLE) here? > > I don't think we can use these macros in the sandbox .in file. sb.in files are preprocessed with wtf/Platform.h included. Why do HAVE macros not work?
Per Arne Vollan
Comment 25 2019-02-07 14:54:41 PST
Per Arne Vollan
Comment 26 2019-02-07 14:55:25 PST
(In reply to Alexey Proskuryakov from comment #24) > Comment on attachment 361431 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361431&action=review > > >>> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:644 > >>> +#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 > >> > >> Can't we use HAVE(CSCHECKFIXDISABLE) here? > > > > I don't think we can use these macros in the sandbox .in file. > > sb.in files are preprocessed with wtf/Platform.h included. Why do HAVE > macros not work? You are absolutely right :) Thanks for reviewing!
WebKit Commit Bot
Comment 27 2019-02-07 16:02:55 PST
Comment on attachment 361453 [details] Patch Clearing flags on attachment: 361453 Committed r241169: <https://trac.webkit.org/changeset/241169>
WebKit Commit Bot
Comment 28 2019-02-07 16:02:57 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.