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