| Summary: | WebProcess sandboxing does not apply for open source builds on macOS 12.0 (beta 2 and later) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Dinesh Kumar Vyas <dinodev90> | ||||||
| Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Major | CC: | ap, dinodev90, jbedard, kkinnunen, pvollan, saagar, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Mac (Apple Silicon) | ||||||||
| OS: | Other | ||||||||
| Attachments: |
|
||||||||
Created attachment 434065 [details]
Patch to fix WebProcess sandboxing issue for open source builds (on macOS 12.0 beta 2 and later)
Added check for USE(APPLE_INTERNAL_SDK) wherever needed as ENABLE_SANDBOX_MESSAGE_FILTER is always NO/false for open source builds and AppleAVDUserClientMessageFilter, IOSurfaceAcceleratorClientMessageFilter and IOMobileFramebufferUserClientMessageFilter are anavailable there which breaks sandbox compilation using sandbox_compile_file
Created attachment 434204 [details]
Patch
Here's a slightly different patch that fixes the conditional instead of conditionalizing on USE(APPLE_INTERNAL_SDK). Like the rest of the profile, it duplicates the allow rule and wraps one side in the check for ENABLE_SANDBOX_MESSAGE_FILTER. I was hoping this would do for now, as it matches what the other code looks like, but I'd be interested to see if there was interest for cleaning this up a bit in across all the message filters in a future patch. Comment on attachment 434204 [details]
Patch
R=me.
Committed r280345 (239992@main): <https://commits.webkit.org/239992@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 434204 [details]. |
WebProcess sandboxing is broken (for local/public builds) on macOS 12.0 (beta 2 and later), causing instant crash/termination of WebProcess. Root cause: ENABLE_SANDBOX_MESSAGE_FILTER is NO for non Apple internal builds and we are using (AppleAVDUserClientMessageFilter) (IOMobileFramebufferUserClientMessageFilter) (IOSurfaceAcceleratorClientMessageFilter) Which are undefined and causing crash on compiling sb file. --------------------------------------------------- Logs: com.apple.WebKit.WebContent.Orion: Could not compile WebContent sandbox: <internal init prelude>:102:28: illegal argument: (internal-strcmp a b #f) sandbox initialization failed: <internal init prelude>:102:28: illegal argument: (internal-strcmp a b #f) com.apple.WebKit.WebContent.Orion: Could not initialize sandbox profile [/Volumes/Macintosh HD/Users/Shared/Development/WebKit/WebKit.framework/Resources/com.apple.WebProcess.sb], error '<internal init prelude>:102:28: illegal argument: (internal-strcmp a b #f) ' ENABLE_SANDBOX_MESSAGE_FILTER=NO _OS_VERSION=12.0 WEBKIT2_FRAMEWORK_DIR=/Volumes/Macintosh HD/Users/Shared/Development/WebKit DARWIN_USER_TEMP_DIR=/private/var/folders/98/bhsc41h91w19w4t4p3l_6_240000gp/T/com.apple.WebKit.WebContent DARWIN_USER_CACHE_DIR=/private/var/folders/98/bhsc41h91w19w4t4p3l_6_240000gp/C/com.apple.WebKit.WebContent HOME_DIR=/Users/dineshkumarvyas HOME_LIBRARY_DIR=/Users/dineshkumarvyas/Library HOME_LIBRARY_PREFERENCES_DIR=/Users/dineshkumarvyas/Library/Preferences CPU=arm64 com.apple.WebKit.WebContent.Orion: Unable to apply sandbox