Bug 228944 - [Monterey] WebContent process immediately crash when GPU Process is disabled
Summary: [Monterey] WebContent process immediately crash when GPU Process is disabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-09 22:19 PDT by Jean-Yves Avenard [:jya]
Modified: 2021-08-11 20:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.67 KB, patch)
2021-08-09 22:25 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (1.46 KB, patch)
2021-08-10 18:47 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (1.44 KB, patch)
2021-08-11 19:27 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-08-09 22:19:13 PDT
[Montarey] WebContent process immediately crash when GPU Process is disabled
Comment 1 Jean-Yves Avenard [:jya] 2021-08-09 22:20:38 PDT
rdar://81727094
Comment 2 Jean-Yves Avenard [:jya] 2021-08-09 22:25:23 PDT
Created attachment 435243 [details]
Patch
Comment 3 Brent Fulgham 2021-08-10 09:39:12 PDT
Comment on attachment 435243 [details]
Patch

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

> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:1453
> +            (require-not (extension "com.apple.webkit.extension.mach"))

This says that if we did not extend access to SYS_getpriority dynamically, allow the syscall. Since we don't currently extend any syscalls dynamically I think this will always be true.

Consequently, I would just add this to the existing "(when (defined? 'syscall-unix)" case inside a version check like we do for SYS_setattrlist.

Please also add the radar and a comment that we should remove it once the GPU Process is permanently enabled.
Comment 4 Jean-Yves Avenard [:jya] 2021-08-10 18:42:23 PDT
Comment on attachment 435243 [details]
Patch

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

> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:1453
> +            (require-not (extension "com.apple.webkit.extension.mach"))

the way that test appears to be used thorough the file is to check if the GPU Process is enabled. require-all tells me that extension "com.apple.webkit.extension.mach" needs to be false for SYS_getpriority to be allowed.

I admit I'm definitely not a sandbox expert 

Also, I can't definitely say that this is only required for MacOS >= 12, it's just where I noticed the problem and that I can definitely test with. it may be required with other OS once AudioToolbox framework gets updated.
Comment 5 Jean-Yves Avenard [:jya] 2021-08-10 18:47:18 PDT
Created attachment 435316 [details]
Patch

Apply comment
Comment 6 Jean-Yves Avenard [:jya] 2021-08-11 19:27:49 PDT
Created attachment 435391 [details]
Patch

update Changelog
Comment 7 Brent Fulgham 2021-08-11 19:38:16 PDT
Comment on attachment 435391 [details]
Patch

R=me
Comment 8 Jean-Yves Avenard [:jya] 2021-08-11 19:52:58 PDT
thank you
Comment 9 EWS 2021-08-11 20:48:36 PDT
Committed r280955 (240461@main): <https://commits.webkit.org/240461@main>

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