Skip to content

Commit

Permalink
Unreviewed, reverting 269832@main.
Browse files Browse the repository at this point in the history
  • Loading branch information
webkit-commit-queue authored and pvollan committed Nov 8, 2023
1 parent 67030da commit 32eadbf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WTF/wtf/PlatformEnableCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@
#define ENABLE_LOCKDOWN_MODE_API 1
#endif

#if !defined(ENABLE_LOCKDOWN_MODE_TELEMETRY) && PLATFORM(MAC)
#define ENABLE_LOCKDOWN_MODE_TELEMETRY 1
#endif

#if !defined(ENABLE_MEDIA_SOURCE) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define ENABLE_MEDIA_SOURCE 1
#endif
Expand Down
18 changes: 18 additions & 0 deletions Source/WebKit/WebProcess/com.apple.WebProcess.sb.in
Original file line number Diff line number Diff line change
Expand Up @@ -2038,11 +2038,18 @@
(allow syscall-unix (syscall-unix-downlevels-blocked-in-lockdown-mode)))
#endif

#if ENABLE(LOCKDOWN_MODE_TELEMETRY)
(with-filter (require-not (lockdown-mode))
(allow syscall-unix (syscall-unix-blocked-in-lockdown-mode))
(when (equal? (param "CPU") "arm64")
(allow syscall-unix (syscall-unix-apple-silicon)))
(allow syscall-unix (with report) (with telemetry) (syscalls-rarely-used-blocked-in-lockdown-mode)))
#else
(allow syscall-unix (syscall-unix-blocked-in-lockdown-mode))
(when (equal? (param "CPU") "arm64")
(allow syscall-unix (syscall-unix-apple-silicon)))
(allow syscall-unix (syscalls-rarely-used-blocked-in-lockdown-mode))
#endif

(when (defined? 'SYS_objc_bp_assist_cfg_np)
(allow syscall-unix (syscall-number SYS_objc_bp_assist_cfg_np)))
Expand All @@ -2057,11 +2064,13 @@
(allow syscall-unix (syscall-number SYS_quotactl)))
#endif

#if ENABLE(LOCKDOWN_MODE_TELEMETRY)
(with-filter (lockdown-mode)
(deny syscall-unix (with telemetry) (syscall-unix-blocked-in-lockdown-mode))
(deny syscall-unix (with telemetry) (syscalls-rarely-used-blocked-in-lockdown-mode))
(when (equal? (param "CPU") "arm64")
(deny syscall-unix (with telemetry) (syscall-unix-apple-silicon))))
#endif

#if HAVE(ADDITIONAL_APPLE_CAMERA_SERVICE)
(if (equal? (param "CPU") "arm64")
Expand Down Expand Up @@ -2188,12 +2197,17 @@
(allow mach-kernel-endpoint
(apply-message-filter
(deny mach-message-send)
#if ENABLE(LOCKDOWN_MODE_TELEMETRY)
(with-filter (require-not (lockdown-mode))
(allow mach-message-send (kernel-mig-routines-blocked-in-lockdown-mode))
(allow mach-message-send (kernel-mig-routines-blocked-in-lockdown-mode-avoid-telemetry)))
(with-filter (lockdown-mode)
(deny mach-message-send (with telemetry) (kernel-mig-routines-blocked-in-lockdown-mode))
(deny mach-message-send (with telemetry) (kernel-mig-routines-blocked-in-lockdown-mode-avoid-telemetry)))
#else
(allow mach-message-send (kernel-mig-routines-blocked-in-lockdown-mode))
(allow mach-message-send (kernel-mig-routines-blocked-in-lockdown-mode-avoid-telemetry))
#endif

(allow mach-message-send (kernel-mig-routines-in-use))
#if !PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED <= 140000
Expand Down Expand Up @@ -2280,10 +2294,14 @@
(with-filter (require-not (lockdown-mode))
(allow syscall-mach (syscall-mach-downlevels-blocked-in-lockdown-mode)))
#endif
#if ENABLE(LOCKDOWN_MODE_TELEMETRY)
(with-filter (require-not (lockdown-mode))
(allow syscall-mach (syscall-mach-blocked-in-lockdown-mode)))
(with-filter (lockdown-mode)
(deny syscall-mach (with telemetry) (syscall-mach-blocked-in-lockdown-mode)))
#else
(allow syscall-mach (syscall-mach-blocked-in-lockdown-mode))
#endif
(when (defined? 'MSC_mach_msg2_trap)
(allow syscall-mach (machtrap-number MSC_mach_msg2_trap))))
#endif // HAVE(SANDBOX_MESSAGE_FILTERING)
Expand Down

0 comments on commit 32eadbf

Please sign in to comment.