Regen after r293450
[freebsd-src.git] / sys / kern / capabilities.conf
blobd0ea97c4e8310dee90c34f2292157901456d1979
1 ##
2 ## Copyright (c) 2008-2010 Robert N. M. Watson
3 ## All rights reserved.
4 ##
5 ## This software was developed at the University of Cambridge Computer
6 ## Laboratory with support from a grant from Google, Inc.
7 ##
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted provided that the following conditions
10 ## are met:
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
27 ## SUCH DAMAGE.
29 ## List of system calls enabled in capability mode, one name per line.
31 ## Notes:
32 ## - sys_exit(2), abort2(2) and close(2) are very important.
33 ## - Sorted alphabetically, please keep it that way.
35 ## $FreeBSD$
39 ## Allow ACL and MAC label operations by file descriptor, subject to
40 ## capability rights.  Allow MAC label operations on the current process but
41 ## we will need to scope __mac_get_pid(2).
43 __acl_aclcheck_fd
44 __acl_delete_fd
45 __acl_get_fd
46 __acl_set_fd
47 __mac_get_fd
48 #__mac_get_pid
49 __mac_get_proc
50 __mac_set_fd
51 __mac_set_proc
54 ## Allow sysctl(2) as we scope internal to the call; this is a global
55 ## namespace, but there are several critical sysctls required for almost
56 ## anything to run, such as hw.pagesize.  For now that policy lives in the
57 ## kernel for performance and simplicity, but perhaps it could move to a
58 ## proxying daemon in userspace.
60 __sysctl
63 ## Allow umtx operations as these are scoped by address space.
65 ## XXRW: Need to check this very carefully.
67 _umtx_lock
68 _umtx_op
69 _umtx_unlock
72 ## Allow process termination using abort2(2).
74 abort2
77 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
78 ## relies on existing bindings on a socket, subject to capability rights.
80 accept
81 accept4
84 ## Allow AIO operations by file descriptor, subject to capability rights.
86 aio_cancel
87 aio_error
88 aio_fsync
89 aio_read
90 aio_return
91 aio_suspend
92 aio_waitcomplete
93 aio_write
96 ## audit(2) is a global operation, submitting to the global trail, but it is
97 ## controlled by privilege, and it might be useful to be able to submit
98 ## records from sandboxes.  For now, disallow, but we may want to think about
99 ## providing some sort of proxy service for this.
101 #audit
104 ## Allow bindat(2).
106 bindat
109 ## Allow capability mode and capability system calls.
111 cap_enter
112 cap_fcntls_get
113 cap_fcntls_limit
114 cap_getmode
115 cap_ioctls_get
116 cap_ioctls_limit
117 __cap_rights_get
118 cap_rights_limit
121 ## Allow read-only clock operations.
123 clock_getres
124 clock_gettime
127 ## Always allow file descriptor close(2).
129 close
130 closefrom
133 ## Allow connectat(2).
135 connectat
138 ## cpuset(2) and related calls require scoping by process, but should
139 ## eventually be allowed, at least in the current process case.
141 #cpuset
142 #cpuset_getaffinity
143 #cpuset_getid
144 #cpuset_setaffinity
145 #cpuset_setid
148 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
151 dup2
154 ## Allow extended attribute operations by file descriptor, subject to
155 ## capability rights.
157 extattr_delete_fd
158 extattr_get_fd
159 extattr_list_fd
160 extattr_set_fd
163 ## Allow changing file flags, mode, and owner by file descriptor, subject to
164 ## capability rights.
166 fchflags
167 fchmod
168 fchown
171 ## For now, allow fcntl(2), subject to capability rights, but this probably
172 ## needs additional scoping.
174 fcntl
177 ## Allow fexecve(2), subject to capability rights.  We perform some scoping,
178 ## such as disallowing privilege escalation.
180 fexecve
183 ## Allow flock(2), subject to capability rights.
185 flock
188 ## Allow fork(2), even though it returns pids -- some applications seem to
189 ## prefer this interface.
191 fork
194 ## Allow fpathconf(2), subject to capability rights.
196 fpathconf
199 ## Allow various file descriptor-based I/O operations, subject to capability
200 ## rights.
202 freebsd6_ftruncate
203 freebsd6_lseek
204 freebsd6_mmap
205 freebsd6_pread
206 freebsd6_pwrite
209 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
210 ## subject to capability rights.
212 fstat
213 fstatfs
216 ## Allow further file descriptor-based I/O operations, subject to capability
217 ## rights.
219 fsync
220 ftruncate
223 ## Allow futimens(2) and futimes(2), subject to capability rights.
225 futimens
226 futimes
229 ## Allow querying process audit state, subject to normal access control.
231 getaudit
232 getaudit_addr
233 getauid
236 ## Allow thread context management with getcontext(2).
238 getcontext
241 ## Allow directory I/O on a file descriptor, subject to capability rights.
242 ## Originally we had separate capabilities for directory-specific read
243 ## operations, but on BSD we allow reading the raw directory data, so we just
244 ## rely on CAP_READ now.
246 getdents
247 getdirentries
250 ## Allow querying certain trivial global state.
252 getdomainname
255 ## Allow querying current process credential state.
257 getegid
258 geteuid
261 ## Allow querying certain trivial global state.
263 gethostid
264 gethostname
267 ## Allow querying per-process timer.
269 getitimer
272 ## Allow querying current process credential state.
274 getgid
275 getgroups
276 getlogin
279 ## Allow querying certain trivial global state.
281 getpagesize
282 getpeername
285 ## Allow querying certain per-process scheduling, resource limit, and
286 ## credential state.
288 ## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
289 ## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
290 ## getsid(2) needs scoping.
292 getpgid
293 getpgrp
294 getpid
295 getppid
296 getpriority
297 getresgid
298 getresuid
299 getrlimit
300 getrusage
301 getsid
304 ## Allow querying socket state, subject to capability rights.
306 ## XXXRW: getsockopt(2) may need more attention.
308 getsockname
309 getsockopt
312 ## Allow querying the global clock.
314 gettimeofday
317 ## Allow querying current process credential state.
319 getuid
322 ## Allow ioctl(2), which hopefully will be limited by applications only to
323 ## required commands with cap_ioctls_limit(2) syscall.
325 ioctl
328 ## Allow querying current process credential state.
330 issetugid
333 ## Allow kevent(2), as we will authorize based on capability rights on the
334 ## target descriptor.
336 kevent
339 ## Allow kill(2), as we allow the process to send signals only to himself.
341 kill
344 ## Allow message queue operations on file descriptors, subject to capability
345 ## rights.
347 kmq_notify
348 kmq_setattr
349 kmq_timedreceive
350 kmq_timedsend
353 ## Allow kqueue(2), we will control use.
355 kqueue
358 ## Allow managing per-process timers.
360 ktimer_create
361 ktimer_delete
362 ktimer_getoverrun
363 ktimer_gettime
364 ktimer_settime
367 ## We can't allow ktrace(2) because it relies on a global namespace, but we
368 ## might want to introduce an fktrace(2) of some sort.
370 #ktrace
373 ## Allow AIO operations by file descriptor, subject to capability rights.
375 lio_listio
378 ## Allow listen(2), subject to capability rights.
380 ## XXXRW: One might argue this manipulates a global namespace.
382 listen
385 ## Allow I/O-related file descriptors, subject to capability rights.
387 lseek
390 ## Allow simple VM operations on the current process.
392 madvise
393 mincore
394 minherit
395 mlock
396 mlockall
399 ## Allow memory mapping a file descriptor, and updating protections, subject
400 ## to capability rights.
402 mmap
403 mprotect
406 ## Allow simple VM operations on the current process.
408 msync
409 munlock
410 munlockall
411 munmap
414 ## Allow the current process to sleep.
416 nanosleep
419 ## Allow querying the global clock.
421 ntp_gettime
424 ## Allow AIO operations by file descriptor, subject to capability rights.
426 oaio_read
427 oaio_write
430 ## Allow simple VM operations on the current process.
432 obreak
435 ## Allow AIO operations by file descriptor, subject to capability rights.
437 olio_listio
440 ## Operations relative to directory capabilities.
442 chflagsat
443 faccessat
444 fchmodat
445 fchownat
446 fstatat
447 futimesat
448 linkat
449 mkdirat
450 mkfifoat
451 mknodat
452 openat
453 readlinkat
454 renameat
455 symlinkat
456 unlinkat
457 utimensat
460 ## Allow entry into open(2). This system call will fail, since access to the
461 ## global file namespace has been disallowed, but allowing entry into the
462 ## syscall means that an audit trail will be generated (which is also very
463 ## useful for debugging).
465 open
468 ## Allow poll(2), which will be scoped by capability rights.
470 ## XXXRW: Perhaps we don't need the OpenBSD version?
471 ## XXXRW: We don't yet do that scoping.
473 openbsd_poll
476 ## Process descriptor-related system calls are allowed.
478 pdfork
479 pdgetpid
480 pdkill
481 #pdwait4        # not yet implemented
484 ## Allow pipe(2).
486 pipe
487 pipe2
490 ## Allow poll(2), which will be scoped by capability rights.
491 ## XXXRW: We don't yet do that scoping.
493 poll
496 ## Allow I/O-related file descriptors, subject to capability rights.
498 pread
499 preadv
502 ## Allow access to profiling state on the current process.
504 profil
507 ## Disallow ptrace(2) for now, but we do need debugging facilities in
508 ## capability mode, so we will want to revisit this, possibly by scoping its
509 ## operation.
511 #ptrace
514 ## Allow I/O-related file descriptors, subject to capability rights.
516 pwrite
517 pwritev
518 read
519 readv
520 recv
521 recvfrom
522 recvmsg
525 ## Allow real-time scheduling primitives to be used.
527 ## XXXRW: These require scoping.
529 rtprio
530 rtprio_thread
533 ## Allow simple VM operations on the current process.
535 sbrk
538 ## Allow querying trivial global scheduler state.
540 sched_get_priority_max
541 sched_get_priority_min
544 ## Allow various thread/process scheduler operations.
546 ## XXXRW: Some of these require further scoping.
548 sched_getparam
549 sched_getscheduler
550 sched_rr_get_interval
551 sched_setparam
552 sched_setscheduler
553 sched_yield
556 ## Allow I/O-related file descriptors, subject to capability rights.
558 sctp_generic_recvmsg
559 sctp_generic_sendmsg
560 sctp_generic_sendmsg_iov
561 sctp_peeloff
564 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
566 ## XXXRW: But is it?
568 pselect
569 select
572 ## Allow I/O-related file descriptors, subject to capability rights.  Use of
573 ## explicit addresses here is restricted by the system calls themselves.
575 send
576 sendfile
577 sendmsg
578 sendto
581 ## Allow setting per-process audit state, which is controlled separately by
582 ## privileges.
584 setaudit
585 setaudit_addr
586 setauid
589 ## Allow setting thread context.
591 setcontext
594 ## Allow setting current process credential state, which is controlled
595 ## separately by privilege.
597 setegid
598 seteuid
599 setgid
602 ## Allow use of the process interval timer.
604 setitimer
607 ## Allow setpriority(2).
609 ## XXXRW: Requires scoping.
611 setpriority
614 ## Allow setting current process credential state, which is controlled
615 ## separately by privilege.
617 setregid
618 setresgid
619 setresuid
620 setreuid
623 ## Allow setting process resource limits with setrlimit(2).
625 setrlimit
628 ## Allow creating a new session with setsid(2).
630 setsid
633 ## Allow setting socket options with setsockopt(2), subject to capability
634 ## rights.
636 ## XXXRW: Might require scoping.
638 setsockopt
641 ## Allow setting current process credential state, which is controlled
642 ## separately by privilege.
644 setuid
647 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
649 shm_open
652 ## Allow I/O-related file descriptors, subject to capability rights.
654 shutdown
657 ## Allow signal control on current process.
659 sigaction
660 sigaltstack
661 sigblock
662 sigpending
663 sigprocmask
664 sigqueue
665 sigreturn
666 sigsetmask
667 sigstack
668 sigsuspend
669 sigtimedwait
670 sigvec
671 sigwaitinfo
672 sigwait
675 ## Allow creating new socket pairs with socket(2) and socketpair(2).
677 socket
678 socketpair
681 ## Allow simple VM operations on the current process.
683 ## XXXRW: Kernel doesn't implement this, so drop?
685 sstk
688 ## Do allow sync(2) for now, but possibly shouldn't.
690 sync
693 ## Always allow process termination with sys_exit(2).
695 sys_exit
698 ## sysarch(2) does rather diverse things, but is required on at least i386
699 ## in order to configure per-thread data.  As such, it's scoped on each
700 ## architecture.
702 sysarch
705 ## Allow thread operations operating only on current process.
707 thr_create
708 thr_exit
709 thr_kill
712 ## Disallow thr_kill2(2), as it may operate beyond the current process.
714 ## XXXRW: Requires scoping.
716 #thr_kill2
719 ## Allow thread operations operating only on current process.
721 thr_new
722 thr_self
723 thr_set_name
724 thr_suspend
725 thr_wake
728 ## Allow manipulation of the current process umask with umask(2).
730 umask
733 ## Allow submitting of process trace entries with utrace(2).
735 utrace
738 ## Allow generating UUIDs with uuidgen(2).
740 uuidgen
743 ## Allow I/O-related file descriptors, subject to capability rights.
745 write
746 writev
749 ## Allow processes to yield(2).
751 yield