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