2 ## Copyright (c) 2008-2010 Robert N. M. Watson
3 ## All rights reserved.
5 ## This software was developed at the University of Cambridge Computer
6 ## Laboratory with support from a grant from Google, Inc.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted provided that the following conditions
11 ## 1. Redistributions of source code must retain the above copyright
12 ## notice, this list of conditions and the following disclaimer.
13 ## 2. Redistributions in binary form must reproduce the above copyright
14 ## notice, this list of conditions and the following disclaimer in the
15 ## documentation and/or other materials provided with the distribution.
17 ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 ## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 ## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 ## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 ## List of system calls enabled in capability mode, one name per line.
31 ## System calls listed here operate either fully or partially in the absence
32 ## of global namespaces or ambient authority. In capability mode system calls
33 ## that operate only on global namespaces or require ambient authority have no
34 ## utility and thus are not permitted.
37 ## - sys_exit(2), abort2(2) and close(2) are very important.
38 ## - Sorted alphabetically, please keep it that way.
44 ## Allow ACL and MAC label operations by file descriptor, subject to
45 ## capability rights. Allow MAC label operations on the current process but
46 ## we will need to scope __mac_get_pid(2).
59 ## Allow creating special file descriptors like eventfd(2).
64 ## Allow sysctl(2) as we scope internal to the call; this is a global
65 ## namespace, but there are several critical sysctls required for almost
66 ## anything to run, such as hw.pagesize. For now that policy lives in the
67 ## kernel for performance and simplicity, but perhaps it could move to a
68 ## proxying daemon in userspace.
74 ## Allow umtx operations as these are scoped by address space.
76 ## XXRW: Need to check this very carefully.
81 ## Allow process termination using abort2(2).
86 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
87 ## relies on existing bindings on a socket, subject to capability rights.
93 ## Allow AIO operations by file descriptor, subject to capability rights.
107 ## audit(2) is a global operation, submitting to the global trail, but it is
108 ## controlled by privilege, and it might be useful to be able to submit
109 ## records from sandboxes. For now, disallow, but we may want to think about
110 ## providing some sort of proxy service for this.
120 ## Allow capability mode and capability system calls.
132 ## Allow read-only clock operations.
138 ## Always allow file descriptor close(2).
145 ## Allow connectat(2).
150 ## copy_file_range(2) reads from one descriptor and writes to the other.
155 ## cpuset(2) and related calls are limited to caller's own process/thread.
166 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
172 ## Allow extended attribute operations by file descriptor, subject to
173 ## capability rights.
181 ## Allow changing file flags, mode, and owner by file descriptor, subject to
182 ## capability rights.
189 ## For now, allow fcntl(2), subject to capability rights, but this probably
190 ## needs additional scoping.
195 ## Allow fexecve(2), subject to capability rights. We perform some scoping,
196 ## such as disallowing privilege escalation.
201 ## Allow flock(2), subject to capability rights.
206 ## Allow fork(2), even though it returns pids -- some applications seem to
207 ## prefer this interface.
212 ## Allow fpathconf(2), subject to capability rights.
217 ## Allow various file descriptor-based I/O operations, subject to capability
222 freebsd11_getdirentries
232 ## Allow I/O-related file operations, subject to capability rights.
237 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
238 ## subject to capability rights.
244 ## Allow further file descriptor-based I/O operations, subject to capability
252 ## Allow futimens(2) and futimes(2), subject to capability rights.
258 ## Allow querying process audit state, subject to normal access control.
265 ## Allow thread context management with getcontext(2).
270 ## Allow directory I/O on a file descriptor, subject to capability rights.
271 ## Originally we had separate capabilities for directory-specific read
272 ## operations, but on BSD we allow reading the raw directory data, so we just
273 ## rely on CAP_READ now.
279 ## Allow querying certain trivial global state.
284 ## Allow querying certain per-process resource limit state.
289 ## Allow querying current process credential state.
295 ## Allow querying certain trivial global state.
301 ## Allow querying per-process timer.
306 ## Allow querying current process credential state.
314 ## Allow querying certain trivial global state.
320 ## Allow querying certain per-process scheduling, resource limit, and
323 ## XXXRW: getpgid(2) needs scoping. It's not clear if it's worth scoping
324 ## getppid(2). getpriority(2) needs scoping. getrusage(2) needs scoping.
325 ## getsid(2) needs scoping.
344 ## Allow querying socket state, subject to capability rights.
346 ## XXXRW: getsockopt(2) may need more attention.
352 ## Allow querying the global clock.
357 ## Allow querying current process credential state.
362 ## Allow ioctl(2), which hopefully will be limited by applications only to
363 ## required commands with cap_ioctls_limit(2) syscall.
368 ## Allow querying current process credential state.
373 ## Allow kevent(2), as we will authorize based on capability rights on the
374 ## target descriptor.
379 ## Allow kill(2), as we allow the process to send signals only to himself.
384 ## Allow message queue operations on file descriptors, subject to capability
386 ## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with
395 ## Allow kqueue(2), we will control use.
400 ## Allow managing per-process timers.
409 ## We can't allow ktrace(2) because it relies on a global namespace, but we
410 ## might want to introduce an fktrace(2) of some sort.
415 ## Allow AIO operations by file descriptor, subject to capability rights.
420 ## Allow listen(2), subject to capability rights.
422 ## XXXRW: One might argue this manipulates a global namespace.
427 ## Allow I/O-related file descriptors, subject to capability rights.
432 ## Allow simple VM operations on the current process.
441 ## Allow memory mapping a file descriptor, and updating protections, subject
442 ## to capability rights.
448 ## Allow simple VM operations on the current process.
456 ## Allow the current process to sleep.
461 ## Allow querying the global clock.
466 ## Allow AIO operations by file descriptor, subject to capability rights.
472 ## Allow simple VM operations on the current process.
477 ## Allow AIO operations by file descriptor, subject to capability rights.
482 ## Operations relative to directory capabilities.
503 ## Process descriptor-related system calls are allowed.
508 #pdwait4 # not yet implemented
517 ## Allow poll(2), which will be scoped by capability rights.
523 ## Allow I/O-related file descriptors, subject to capability rights.
530 ## Allow access to profiling state on the current process.
535 ## Disallow ptrace(2) for now, but we do need debugging facilities in
536 ## capability mode, so we will want to revisit this, possibly by scoping its
542 ## Allow I/O-related file descriptors, subject to capability rights.
553 ## Allow real-time scheduling primitives to be used.
555 ## XXXRW: These require scoping.
561 ## Allow simple VM operations on the current process.
566 ## Allow querying trivial global scheduler state.
568 sched_get_priority_max
569 sched_get_priority_min
572 ## Allow various thread/process scheduler operations.
574 ## XXXRW: Some of these require further scoping.
578 sched_rr_get_interval
584 ## Allow I/O-related file descriptors, subject to capability rights.
585 ## NOTE: Corresponding sysents are initialized in sys/netinet/sctp_syscalls.c
586 ## with SYF_CAPENABLED.
590 sctp_generic_sendmsg_iov
594 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
602 ## Allow I/O-related file descriptors, subject to capability rights. Use of
603 ## explicit addresses here is restricted by the system calls themselves.
611 ## Allow setting per-process audit state, which is controlled separately by
619 ## Allow setting thread context.
624 ## Allow setting current process credential state, which is controlled
625 ## separately by privilege.
632 ## Allow use of the process interval timer.
637 ## Allow setpriority(2).
639 ## XXXRW: Requires scoping.
644 ## Allow setting current process credential state, which is controlled
645 ## separately by privilege.
653 ## Allow setting process resource limits with setrlimit(2).
658 ## Allow creating a new session with setsid(2).
663 ## Allow setting socket options with setsockopt(2), subject to capability
666 ## XXXRW: Might require scoping.
671 ## Allow setting current process credential state, which is controlled
672 ## separately by privilege.
677 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
683 ## Allow I/O-related file descriptors, subject to capability rights.
688 ## Allow signal control on current process.
707 ## Allow creating new socket pairs with socket(2) and socketpair(2).
713 ## Allow simple VM operations on the current process.
715 ## XXXRW: Kernel doesn't implement this, so drop?
720 ## Do allow sync(2) for now, but possibly shouldn't.
725 ## Always allow process termination with sys_exit(2).
730 ## sysarch(2) does rather diverse things, but is required on at least i386
731 ## in order to configure per-thread data. As such, it's scoped on each
737 ## Allow thread operations operating only on current process.
744 ## Disallow thr_kill2(2), as it may operate beyond the current process.
746 ## XXXRW: Requires scoping.
751 ## Allow thread operations operating only on current process.
760 ## Allow manipulation of the current process umask with umask(2).
765 ## Allow submitting of process trace entries with utrace(2).
770 ## Allow generating UUIDs with uuidgen(2).
775 ## Allow I/O-related file descriptors, subject to capability rights.
781 ## Allow processes to yield(2).