<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[286673] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/286673">286673</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2021-12-08 12:04:20 -0800 (Wed, 08 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WP] Block unused sys calls
https://bugs.webkit.org/show_bug.cgi?id=233999

Reviewed by Brent Fulgham.

Block sys calls in the WebContent process on iOS that are unused according to telemetry.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitResourcesSandboxProfilesioscomappleWebKitWebContentsbin">trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (286672 => 286673)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-12-08 20:02:41 UTC (rev 286672)
+++ trunk/Source/WebKit/ChangeLog       2021-12-08 20:04:20 UTC (rev 286673)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-12-08  Per Arne Vollan  <pvollan@apple.com>
+
+        [iOS][WP] Block unused sys calls
+        https://bugs.webkit.org/show_bug.cgi?id=233999
+
+        Reviewed by Brent Fulgham.
+
+        Block sys calls in the WebContent process on iOS that are unused according to telemetry.
+
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
+
</ins><span class="cx"> 2021-12-08  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Momentum Event Dispatcher: Momentum tail should have montonically decreasing deltas and tail gaps
</span></span></pre></div>
<a id="trunkSourceWebKitResourcesSandboxProfilesioscomappleWebKitWebContentsbin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in (286672 => 286673)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in      2021-12-08 20:02:41 UTC (rev 286672)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in 2021-12-08 20:04:20 UTC (rev 286673)
</span><span class="lines">@@ -1289,72 +1289,36 @@
</span><span class="cx"> 
</span><span class="cx"> (define (syscall-unix-rarely-in-use)
</span><span class="cx">     (syscall-number
</span><ins>+        SYS_dup
</ins><span class="cx">         SYS_fgetxattr
</span><ins>+        SYS_fstatat64
+        SYS_fsync
</ins><span class="cx">         SYS_getgid
</span><span class="cx">         SYS_getxattr
</span><ins>+        SYS_mkdirat
</ins><span class="cx">         SYS_necp_client_action
</span><span class="cx">         SYS_necp_open
</span><ins>+        SYS_openat_nocancel
+        SYS_pread_nocancel
+        SYS_rmdir
</ins><span class="cx">         SYS_sendto
</span><span class="cx">         SYS_setrlimit
</span><span class="cx">         SYS_sigaltstack
</span><ins>+        SYS_sigprocmask
</ins><span class="cx">         SYS_socket
</span><del>-        SYS_thread_selfusage))
</del><ins>+        SYS_thread_selfusage
+        SYS_unlink
+        SYS_writev))
</ins><span class="cx"> 
</span><del>-(define (syscall-unix-possibly-not-in-use)
</del><ins>+(define (syscall-unix-rarely-in-use-need-backtrace)
</ins><span class="cx">     (syscall-number
</span><span class="cx">         SYS___pthread_kill
</span><del>-        SYS___pthread_markcancel
</del><span class="cx">         SYS___pthread_sigmask
</span><span class="cx">         SYS___semwait_signal
</span><del>-        SYS___semwait_signal_nocancel
-        SYS_chmod
-        SYS_connect
-        SYS_connect_nocancel
-        SYS_connectx
-        SYS_csrctl
-        SYS_dup
-        SYS_fchmod
-        SYS_fileport_makeport
-        SYS_fstatat64
-        SYS_fsync
</del><span class="cx">         SYS_getattrlistbulk ;; xpc_realpath and directory enumeration
</span><del>-        SYS_getaudit_addr
-        SYS_getpeername
-        SYS_getsockopt ;; used by libwebrtc
-        SYS_kdebug_trace
-        SYS_mkdirat
-        SYS_mlock
-        SYS_mremap_encrypted
-        SYS_munlock
</del><span class="cx">         SYS_open_dprotected_np
</span><del>-        SYS_openat_nocancel
-        SYS_persona
-        SYS_pipe
-        SYS_pread_nocancel
-        SYS_proc_rlimit_control
-        SYS_process_policy
</del><span class="cx">         SYS_psynch_rw_wrlock
</span><del>-        SYS_pwrite
-        SYS_recvfrom
-        SYS_recvfrom_nocancel
-        SYS_rmdir
-        SYS_select
-        SYS_select_nocancel
-        SYS_sem_post
-        SYS_sem_wait
-        SYS_sendmsg_nocancel
-        SYS_sendto_nocancel
-        SYS_setpriority
-        SYS_setsockopt
-        SYS_shutdown
-        SYS_sigprocmask
-        SYS_sigreturn
-        SYS_socketpair
-        SYS_umask
-        SYS_unlink
-        SYS_work_interval_ctl
-        SYS_write
-        SYS_writev))
</del><ins>+        SYS_umask))
</ins><span class="cx"> 
</span><span class="cx"> (when (defined? 'syscall-unix)
</span><span class="cx">     (deny syscall-unix (with send-signal SIGKILL))
</span><span class="lines">@@ -1378,7 +1342,7 @@
</span><span class="cx">         (syscall-unix-rarely-in-use))
</span><span class="cx"> 
</span><span class="cx">     (allow syscall-unix (with report) (with telemetry-backtrace)
</span><del>-        (syscall-unix-possibly-not-in-use))
</del><ins>+        (syscall-unix-rarely-in-use-need-backtrace))
</ins><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> (when (defined? 'SYS__map_with_linking_np)
</span><span class="lines">@@ -1555,14 +1519,9 @@
</span><span class="cx">         MSC_semaphore_wait_trap
</span><span class="cx">         MSC_syscall_thread_switch
</span><span class="cx">         MSC_task_name_for_pid
</span><del>-        MSC_thread_get_special_reply_port))
-
-(define (syscall-mach-possibly-unused)
-    (machtrap-number
-        MSC_mach_msg_overwrite_trap
-        MSC_mk_timer_arm_leeway
</del><ins>+        MSC_thread_get_special_reply_port
</ins><span class="cx">         MSC_thread_self_trap))
</span><del>-
</del><ins>+    
</ins><span class="cx"> (when (defined? 'syscall-mach)
</span><span class="cx">     (deny syscall-mach
</span><span class="cx">         (machtrap-number MSC_mach_wait_until))
</span><span class="lines">@@ -1587,9 +1546,6 @@
</span><span class="cx">             (with message "Mach syscall used after launch")
</span><span class="cx">             (syscall-mach-only-in-use-during-launch)))
</span><span class="cx"> #endif
</span><del>-
-    (allow syscall-mach (with telemetry-backtrace)
-        (syscall-mach-possibly-unused))
</del><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> (define (kernel-mig-routine-only-in-use-during-launch)
</span><span class="lines">@@ -1632,26 +1588,16 @@
</span><span class="cx">         thread_set_exception_ports
</span><span class="cx">         thread_suspend))
</span><span class="cx"> 
</span><del>-(define (kernel-mig-routine-possibly-unused)
</del><ins>+(define (kernel-mig-routine-rarely-used-need-backtrace)
</ins><span class="cx">     (kernel-mig-routine
</span><span class="cx">         clock_get_time
</span><del>-        host_request_notification
</del><span class="cx">         io_connect_add_client
</span><del>-        io_connect_map_memory_into_task
-        (when (defined? 'io_connect_set_notification_port) io_connect_set_notification_port)
-        io_registry_entry_get_parent_iterator
-        io_service_add_notification_bin
-        io_service_add_notification_bin_64
</del><span class="cx">         io_service_close
</span><span class="cx">         mach_exception_raise
</span><del>-        (when (defined? 'mach_make_memory_entry) mach_make_memory_entry)
-        (when (defined? 'mach_make_memory_entry_64) mach_make_memory_entry_64)
</del><span class="cx">         mach_port_request_notification
</span><span class="cx">         mach_vm_region
</span><span class="cx">         mach_vm_region_recurse
</span><del>-        task_threads_from_user
-        (when (defined? 'vm_copy) vm_copy)
-        (when (defined? 'vm_remap_external) vm_remap_external)))
</del><ins>+        task_threads_from_user))
</ins><span class="cx"> 
</span><span class="cx"> (define (kernel-mig-routine-rarely-used)
</span><span class="cx">     (kernel-mig-routine
</span><span class="lines">@@ -1666,7 +1612,7 @@
</span><span class="cx">         (apply-message-filter
</span><span class="cx">             (deny mach-message-send (with telemetry))
</span><span class="cx">             (allow mach-message-send (with telemetry-backtrace)
</span><del>-                (kernel-mig-routine-possibly-unused))
</del><ins>+                (kernel-mig-routine-rarely-used-need-backtrace))
</ins><span class="cx"> 
</span><span class="cx">             (allow mach-message-send (with telemetry)
</span><span class="cx">                 (kernel-mig-routine-rarely-used))
</span></span></pre>
</div>
</div>

</body>
</html>