Changeset 291626 in webkit


Ignore:
Timestamp:
Mar 22, 2022 10:19:45 AM (2 years ago)
Author:
pvollan@apple.com
Message:

[macOS][WP] Add telemetry for syscalls used during launch
https://bugs.webkit.org/show_bug.cgi?id=235865
<rdar://problem/88228583>

Reviewed by Brent Fulgham.

Add telemetry in the WebContent process' sandbox on macOS to determine which syscalls are used only during launch.

  • WebProcess/com.apple.WebProcess.sb.in:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r291625 r291626  
     12022-03-22  Per Arne Vollan  <pvollan@apple.com>
     2
     3        [macOS][WP] Add telemetry for syscalls used during launch
     4        https://bugs.webkit.org/show_bug.cgi?id=235865
     5        <rdar://problem/88228583>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add telemetry in the WebContent process' sandbox on macOS to determine which syscalls are used only during launch.
     10
     11        * WebProcess/com.apple.WebProcess.sb.in:
     12
    1132022-03-22  J Pascoe  <j_pascoe@apple.com>
    214
  • trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in

    r291297 r291626  
    18771877#endif
    18781878
    1879 (define (syscall-unix-common)
     1879#if HAVE(SANDBOX_STATE_FLAGS)
     1880(deny user-preference-read (with enable-state-flag "WebContentProcessLaunched")
     1881    (preference-domain "com.apple.WebKit.WebContent.Launch"))
     1882#endif
     1883
     1884(define (syscall-unix-only-in-use-during-launch)
     1885    (syscall-number
     1886        SYS_csops
     1887        SYS_csrctl
     1888        SYS_fsgetpath
     1889        SYS_getaudit_addr
     1890        SYS_getfsstat64
     1891        SYS_getrlimit
     1892        SYS_kdebug_trace
     1893        SYS_pathconf
     1894        SYS_statfs64))
     1895
     1896(define (syscall-unix-in-use-after-launch)
    18801897    (syscall-number
    18811898        SYS___disable_threadsignal
     
    18891906        SYS_close
    18901907        SYS_close_nocancel
    1891         SYS_csops
    18921908        SYS_csops_audittoken
    1893         SYS_csrctl
    18941909        SYS_exit
    18951910        SYS_faccessat ;; <rdar://problem/56690456>
     
    19001915        SYS_flock
    19011916        SYS_fsetxattr ;; <rdar://problem/56332491>
    1902         SYS_fsgetpath
    19031917        SYS_fstat64
    19041918        SYS_fstatat64
     
    19071921        SYS_getattrlist
    19081922        SYS_getattrlistbulk
    1909         SYS_getaudit_addr
    19101923        SYS_getdirentries64
    19111924        SYS_getentropy
    19121925        SYS_geteuid
    1913         SYS_getfsstat64
    19141926        SYS_getgid
    19151927        SYS_gethostuuid
    1916         SYS_getrlimit
    19171928        SYS_getrusage
    19181929        SYS_gettimeofday
     
    19211932        SYS_ioctl
    19221933        SYS_issetugid
    1923         SYS_kdebug_trace
    19241934        SYS_kdebug_trace64
    19251935        SYS_kdebug_trace_string ;; Needed for performance sampling, see <rdar://problem/48829655>.
     
    19441954        SYS_open_nocancel
    19451955        SYS_openat
    1946         SYS_pathconf
    19471956        SYS_pread
    19481957        SYS_proc_info
     
    19621971        SYS_sigaltstack
    19631972        SYS_sigprocmask
     1973        SYS_socket
    19641974        SYS_stat64
    1965         SYS_statfs64
    1966         SYS_socket
    19671975        SYS_sysctlbyname
    19681976        SYS_thread_selfid
     
    20302038
    20312039(when (defined? 'syscall-unix)
    2032     (deny syscall-unix (with send-signal SIGKILL))
     2040    (deny syscall-unix (with telemetry) (with send-signal SIGKILL))
    20332041    (allow syscall-unix
    2034         (syscall-unix-common))
     2042        (syscall-unix-in-use-after-launch)
     2043        (syscall-unix-only-in-use-during-launch))
     2044
     2045#if HAVE(SANDBOX_STATE_FLAGS)
     2046    (with-filter (state-flag "WebContentProcessLaunched")
     2047        (deny syscall-unix
     2048            (syscall-unix-only-in-use-during-launch))
     2049        (allow syscall-unix
     2050            (with report)
     2051            (with telemetry)
     2052            (with message "Unix syscall used after launch")
     2053            (syscall-unix-only-in-use-during-launch)))
     2054#endif
    20352055
    20362056    (if (equal? (param "CPU") "arm64")
Note: See TracChangeset for help on using the changeset viewer.