]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/capabilities.conf
Merge ^/vendor/clang/dist up to its last change, and resolve conflicts.
[FreeBSD/FreeBSD.git] / sys / kern / capabilities.conf
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.
16 ##
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.
28 ##
29 ## List of system calls enabled in capability mode, one name per line.
30 ##
31 ## Notes:
32 ## - sys_exit(2), abort2(2) and close(2) are very important.
33 ## - Sorted alphabetically, please keep it that way.
34 ##
35 ## $FreeBSD$
36 ##
37
38 ##
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).
42 ##
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
52
53 ##
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.
59 ##
60 __sysctl
61 __sysctlbyname
62
63 ##
64 ## Allow umtx operations as these are scoped by address space.
65 ##
66 ## XXRW: Need to check this very carefully.
67 ##
68 _umtx_op
69
70 ##
71 ## Allow process termination using abort2(2).
72 ##
73 abort2
74
75 ##
76 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
77 ## relies on existing bindings on a socket, subject to capability rights.
78 ##
79 accept
80 accept4
81
82 ##
83 ## Allow AIO operations by file descriptor, subject to capability rights.
84 ##
85 aio_cancel
86 aio_error
87 aio_fsync
88 aio_read
89 aio_return
90 aio_suspend
91 aio_waitcomplete
92 aio_write
93
94 ##
95 ## audit(2) is a global operation, submitting to the global trail, but it is
96 ## controlled by privilege, and it might be useful to be able to submit
97 ## records from sandboxes.  For now, disallow, but we may want to think about
98 ## providing some sort of proxy service for this.
99 ##
100 #audit
101
102 ##
103 ## Allow bindat(2).
104 ##
105 bindat
106
107 ##
108 ## Allow capability mode and capability system calls.
109 ##
110 cap_enter
111 cap_fcntls_get
112 cap_fcntls_limit
113 cap_getmode
114 cap_ioctls_get
115 cap_ioctls_limit
116 __cap_rights_get
117 cap_rights_limit
118
119 ##
120 ## Allow read-only clock operations.
121 ##
122 clock_getres
123 clock_gettime
124
125 ##
126 ## Always allow file descriptor close(2).
127 ##
128 close
129 closefrom
130
131 ##
132 ## Allow connectat(2).
133 ##
134 connectat
135
136 ##
137 ## copy_file_range(2) reads from one descriptor and writes to the other.
138 ##
139 copy_file_range
140
141 ##
142 ## cpuset(2) and related calls are limited to caller's own process/thread.
143 ##
144 #cpuset
145 cpuset_getaffinity
146 #cpuset_getid
147 cpuset_setaffinity
148 #cpuset_setid
149
150 ##
151 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
152 ##
153 dup
154 dup2
155
156 ##
157 ## Allow extended attribute operations by file descriptor, subject to
158 ## capability rights.
159 ##
160 extattr_delete_fd
161 extattr_get_fd
162 extattr_list_fd
163 extattr_set_fd
164
165 ##
166 ## Allow changing file flags, mode, and owner by file descriptor, subject to
167 ## capability rights.
168 ##
169 fchflags
170 fchmod
171 fchown
172
173 ##
174 ## For now, allow fcntl(2), subject to capability rights, but this probably
175 ## needs additional scoping.
176 ##
177 fcntl
178
179 ##
180 ## Allow fexecve(2), subject to capability rights.  We perform some scoping,
181 ## such as disallowing privilege escalation.
182 ##
183 fexecve
184
185 ##
186 ## Allow flock(2), subject to capability rights.
187 ##
188 flock
189
190 ##
191 ## Allow fork(2), even though it returns pids -- some applications seem to
192 ## prefer this interface.
193 ##
194 fork
195
196 ##
197 ## Allow fpathconf(2), subject to capability rights.
198 ##
199 fpathconf
200
201 ##
202 ## Allow various file descriptor-based I/O operations, subject to capability
203 ## rights.
204 ##
205 freebsd11_fstat
206 freebsd11_fstatat
207 freebsd11_getdirentries
208 freebsd11_fstatfs
209 freebsd11_mknodat
210 freebsd6_ftruncate
211 freebsd6_lseek
212 freebsd6_mmap
213 freebsd6_pread
214 freebsd6_pwrite
215
216 ##
217 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
218 ## subject to capability rights.
219 ##
220 fstat
221 fstatfs
222
223 ##
224 ## Allow further file descriptor-based I/O operations, subject to capability
225 ## rights.
226 ##
227 fsync
228 ftruncate
229
230 ##
231 ## Allow futimens(2) and futimes(2), subject to capability rights.
232 ##
233 futimens
234 futimes
235
236 ##
237 ## Allow querying process audit state, subject to normal access control.
238 ##
239 getaudit
240 getaudit_addr
241 getauid
242
243 ##
244 ## Allow thread context management with getcontext(2).
245 ##
246 getcontext
247
248 ##
249 ## Allow directory I/O on a file descriptor, subject to capability rights.
250 ## Originally we had separate capabilities for directory-specific read
251 ## operations, but on BSD we allow reading the raw directory data, so we just
252 ## rely on CAP_READ now.
253 ##
254 getdents
255 getdirentries
256
257 ##
258 ## Allow querying certain trivial global state.
259 ##
260 getdomainname
261
262 ##
263 ## Allow querying certain per-process resource limit state.
264 ##
265 getdtablesize
266
267 ##
268 ## Allow querying current process credential state.
269 ##
270 getegid
271 geteuid
272
273 ##
274 ## Allow querying certain trivial global state.
275 ##
276 gethostid
277 gethostname
278
279 ##
280 ## Allow querying per-process timer.
281 ##
282 getitimer
283
284 ##
285 ## Allow querying current process credential state.
286 ##
287 getgid
288 getgroups
289 getlogin
290
291 ##
292 ## Allow querying certain trivial global state.
293 ##
294 getpagesize
295 getpeername
296
297 ##
298 ## Allow querying certain per-process scheduling, resource limit, and
299 ## credential state.
300 ##
301 ## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
302 ## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
303 ## getsid(2) needs scoping.
304 ##
305 getpgid
306 getpgrp
307 getpid
308 getppid
309 getpriority
310 getresgid
311 getresuid
312 getrlimit
313 getrusage
314 getsid
315
316 ##
317 ## Allow getrandom
318 ##
319 getrandom
320
321 ##
322 ## Allow querying socket state, subject to capability rights.
323 ##
324 ## XXXRW: getsockopt(2) may need more attention.
325 ##
326 getsockname
327 getsockopt
328
329 ##
330 ## Allow querying the global clock.
331 ##
332 gettimeofday
333
334 ##
335 ## Allow querying current process credential state.
336 ##
337 getuid
338
339 ##
340 ## Allow ioctl(2), which hopefully will be limited by applications only to
341 ## required commands with cap_ioctls_limit(2) syscall.
342 ##
343 ioctl
344
345 ##
346 ## Allow querying current process credential state.
347 ##
348 issetugid
349
350 ##
351 ## Allow kevent(2), as we will authorize based on capability rights on the
352 ## target descriptor.
353 ##
354 kevent
355
356 ##
357 ## Allow kill(2), as we allow the process to send signals only to himself.
358 ##
359 kill
360
361 ##
362 ## Allow message queue operations on file descriptors, subject to capability
363 ## rights.
364 ## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with
365 ## SYF_CAPENABLED.
366 ##
367 kmq_notify
368 kmq_setattr
369 kmq_timedreceive
370 kmq_timedsend
371
372 ##
373 ## Allow kqueue(2), we will control use.
374 ##
375 kqueue
376
377 ##
378 ## Allow managing per-process timers.
379 ##
380 ktimer_create
381 ktimer_delete
382 ktimer_getoverrun
383 ktimer_gettime
384 ktimer_settime
385
386 ##
387 ## We can't allow ktrace(2) because it relies on a global namespace, but we
388 ## might want to introduce an fktrace(2) of some sort.
389 ##
390 #ktrace
391
392 ##
393 ## Allow AIO operations by file descriptor, subject to capability rights.
394 ##
395 lio_listio
396
397 ##
398 ## Allow listen(2), subject to capability rights.
399 ##
400 ## XXXRW: One might argue this manipulates a global namespace.
401 ##
402 listen
403
404 ##
405 ## Allow I/O-related file descriptors, subject to capability rights.
406 ##
407 lseek
408
409 ##
410 ## Allow simple VM operations on the current process.
411 ##
412 madvise
413 mincore
414 minherit
415 mlock
416 mlockall
417
418 ##
419 ## Allow memory mapping a file descriptor, and updating protections, subject
420 ## to capability rights.
421 ##
422 mmap
423 mprotect
424
425 ##
426 ## Allow simple VM operations on the current process.
427 ##
428 msync
429 munlock
430 munlockall
431 munmap
432
433 ##
434 ## Allow the current process to sleep.
435 ##
436 nanosleep
437
438 ##
439 ## Allow querying the global clock.
440 ##
441 ntp_gettime
442
443 ##
444 ## Allow AIO operations by file descriptor, subject to capability rights.
445 ##
446 oaio_read
447 oaio_write
448
449 ##
450 ## Allow simple VM operations on the current process.
451 ##
452 break
453
454 ##
455 ## Allow AIO operations by file descriptor, subject to capability rights.
456 ##
457 olio_listio
458
459 ##
460 ## Operations relative to directory capabilities.
461 ##
462 chflagsat
463 faccessat
464 fchmodat
465 fchownat
466 fstatat
467 futimesat
468 linkat
469 mkdirat
470 mkfifoat
471 mknodat
472 openat
473 readlinkat
474 renameat
475 symlinkat
476 unlinkat
477 funlinkat
478 utimensat
479
480 ##
481 ## Process descriptor-related system calls are allowed.
482 ##
483 pdfork
484 pdgetpid
485 pdkill
486 #pdwait4        # not yet implemented
487
488 ##
489 ## Allow pipe(2).
490 ##
491 pipe
492 pipe2
493
494 ##
495 ## Allow poll(2), which will be scoped by capability rights.
496 ##
497 poll
498 ppoll
499
500 ##
501 ## Allow I/O-related file descriptors, subject to capability rights.
502 ##
503 posix_fallocate
504 pread
505 preadv
506
507 ##
508 ## Allow access to profiling state on the current process.
509 ##
510 profil
511
512 ##
513 ## Disallow ptrace(2) for now, but we do need debugging facilities in
514 ## capability mode, so we will want to revisit this, possibly by scoping its
515 ## operation.
516 ##
517 #ptrace
518
519 ##
520 ## Allow I/O-related file descriptors, subject to capability rights.
521 ##
522 pwrite
523 pwritev
524 read
525 readv
526 recv
527 recvfrom
528 recvmsg
529
530 ##
531 ## Allow real-time scheduling primitives to be used.
532 ##
533 ## XXXRW: These require scoping.
534 ##
535 rtprio
536 rtprio_thread
537
538 ##
539 ## Allow simple VM operations on the current process.
540 ##
541 sbrk
542
543 ##
544 ## Allow querying trivial global scheduler state.
545 ##
546 sched_get_priority_max
547 sched_get_priority_min
548
549 ##
550 ## Allow various thread/process scheduler operations.
551 ##
552 ## XXXRW: Some of these require further scoping.
553 ##
554 sched_getparam
555 sched_getscheduler
556 sched_rr_get_interval
557 sched_setparam
558 sched_setscheduler
559 sched_yield
560
561 ##
562 ## Allow I/O-related file descriptors, subject to capability rights.
563 ## NOTE: Corresponding sysents are initialized in sys/netinet/sctp_syscalls.c
564 ## with SYF_CAPENABLED.
565 ##
566 sctp_generic_recvmsg
567 sctp_generic_sendmsg
568 sctp_generic_sendmsg_iov
569 sctp_peeloff
570
571 ##
572 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
573 ##
574 ## XXXRW: But is it?
575 ##
576 pselect
577 select
578
579 ##
580 ## Allow I/O-related file descriptors, subject to capability rights.  Use of
581 ## explicit addresses here is restricted by the system calls themselves.
582 ##
583 send
584 sendfile
585 sendmsg
586 sendto
587
588 ##
589 ## Allow setting per-process audit state, which is controlled separately by
590 ## privileges.
591 ##
592 setaudit
593 setaudit_addr
594 setauid
595
596 ##
597 ## Allow setting thread context.
598 ##
599 setcontext
600
601 ##
602 ## Allow setting current process credential state, which is controlled
603 ## separately by privilege.
604 ##
605 setegid
606 seteuid
607 setgid
608
609 ##
610 ## Allow use of the process interval timer.
611 ##
612 setitimer
613
614 ##
615 ## Allow setpriority(2).
616 ##
617 ## XXXRW: Requires scoping.
618 ##
619 setpriority
620
621 ##
622 ## Allow setting current process credential state, which is controlled
623 ## separately by privilege.
624 ##
625 setregid
626 setresgid
627 setresuid
628 setreuid
629
630 ##
631 ## Allow setting process resource limits with setrlimit(2).
632 ##
633 setrlimit
634
635 ##
636 ## Allow creating a new session with setsid(2).
637 ##
638 setsid
639
640 ##
641 ## Allow setting socket options with setsockopt(2), subject to capability
642 ## rights.
643 ##
644 ## XXXRW: Might require scoping.
645 ##
646 setsockopt
647
648 ##
649 ## Allow setting current process credential state, which is controlled
650 ## separately by privilege.
651 ##
652 setuid
653
654 ##
655 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
656 ##
657 shm_open
658 shm_open2
659
660 ##
661 ## Allow I/O-related file descriptors, subject to capability rights.
662 ##
663 shutdown
664
665 ##
666 ## Allow signal control on current process.
667 ##
668 sigaction
669 sigaltstack
670 sigblock
671 sigpending
672 sigprocmask
673 sigqueue
674 sigreturn
675 sigsetmask
676 sigstack
677 sigsuspend
678 sigtimedwait
679 sigvec
680 sigwaitinfo
681 sigwait
682
683 ##
684 ## Allow creating new socket pairs with socket(2) and socketpair(2).
685 ##
686 socket
687 socketpair
688
689 ##
690 ## Allow simple VM operations on the current process.
691 ##
692 ## XXXRW: Kernel doesn't implement this, so drop?
693 ##
694 sstk
695
696 ##
697 ## Do allow sync(2) for now, but possibly shouldn't.
698 ##
699 sync
700
701 ##
702 ## Always allow process termination with sys_exit(2).
703 ##
704 sys_exit
705
706 ##
707 ## sysarch(2) does rather diverse things, but is required on at least i386
708 ## in order to configure per-thread data.  As such, it's scoped on each
709 ## architecture.
710 ##
711 sysarch
712
713 ##
714 ## Allow thread operations operating only on current process.
715 ##
716 thr_create
717 thr_exit
718 thr_kill
719
720 ##
721 ## Disallow thr_kill2(2), as it may operate beyond the current process.
722 ##
723 ## XXXRW: Requires scoping.
724 ##
725 #thr_kill2
726
727 ##
728 ## Allow thread operations operating only on current process.
729 ##
730 thr_new
731 thr_self
732 thr_set_name
733 thr_suspend
734 thr_wake
735
736 ##
737 ## Allow manipulation of the current process umask with umask(2).
738 ##
739 umask
740
741 ##
742 ## Allow submitting of process trace entries with utrace(2).
743 ##
744 utrace
745
746 ##
747 ## Allow generating UUIDs with uuidgen(2).
748 ##
749 uuidgen
750
751 ##
752 ## Allow I/O-related file descriptors, subject to capability rights.
753 ##
754 write
755 writev
756
757 ##
758 ## Allow processes to yield(2).
759 ##
760 yield