Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary call to sandbox_enable_state_flag #14889

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -904,11 +904,6 @@
#if ENABLE(WEBCONTENT_GPU_SANDBOX_EXTENSIONS_BLOCKING)
(deny iokit-open-service (with no-report))
#elif HAVE(SANDBOX_STATE_FLAGS)
;; This rule enables the WebContent process to enable the "BlockIOKitInWebContentSandbox" sandbox variable
;; by reading a preference from the domain "com.apple.WebKit.WebContent.BlockIOKitInWebContentSandbox".
(deny user-preference-read (with enable-state-flag "BlockIOKitInWebContentSandbox")
(preference-domain "com.apple.WebKit.WebContent.BlockIOKitInWebContentSandbox"))

(with-filter (state-flag "BlockIOKitInWebContentSandbox")
(deny iokit-open-service)
(deny iokit-open-user-client (with telemetry-backtrace)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
&& m_shouldPlayMediaInGPUProcess;

if (shouldBlockIOKit) {
#if HAVE(SANDBOX_STATE_FLAGS)
#if HAVE(SANDBOX_STATE_FLAGS) && !ENABLE(WEBCONTENT_GPU_SANDBOX_EXTENSIONS_BLOCKING)
auto auditToken = WebProcess::singleton().auditTokenForSelf();
sandbox_enable_state_flag("BlockIOKitInWebContentSandbox", *auditToken);
#endif
Expand Down