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