]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/capabilities.conf
Allow fdatasync in capability mode
[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 fdatasync
228 fsync
229 ftruncate
230
231 ##
232 ## Allow futimens(2) and futimes(2), subject to capability rights.
233 ##
234 futimens
235 futimes
236
237 ##
238 ## Allow querying process audit state, subject to normal access control.
239 ##
240 getaudit
241 getaudit_addr
242 getauid
243
244 ##
245 ## Allow thread context management with getcontext(2).
246 ##
247 getcontext
248
249 ##
250 ## Allow directory I/O on a file descriptor, subject to capability rights.
251 ## Originally we had separate capabilities for directory-specific read
252 ## operations, but on BSD we allow reading the raw directory data, so we just
253 ## rely on CAP_READ now.
254 ##
255 getdents
256 getdirentries
257
258 ##
259 ## Allow querying certain trivial global state.
260 ##
261 getdomainname
262
263 ##
264 ## Allow querying certain per-process resource limit state.
265 ##
266 getdtablesize
267
268 ##
269 ## Allow querying current process credential state.
270 ##
271 getegid
272 geteuid
273
274 ##
275 ## Allow querying certain trivial global state.
276 ##
277 gethostid
278 gethostname
279
280 ##
281 ## Allow querying per-process timer.
282 ##
283 getitimer
284
285 ##
286 ## Allow querying current process credential state.
287 ##
288 getgid
289 getgroups
290 getlogin
291
292 ##
293 ## Allow querying certain trivial global state.
294 ##
295 getpagesize
296 getpeername
297
298 ##
299 ## Allow querying certain per-process scheduling, resource limit, and
300 ## credential state.
301 ##
302 ## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
303 ## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
304 ## getsid(2) needs scoping.
305 ##
306 getpgid
307 getpgrp
308 getpid
309 getppid
310 getpriority
311 getresgid
312 getresuid
313 getrlimit
314 getrusage
315 getsid
316
317 ##
318 ## Allow getrandom
319 ##
320 getrandom
321
322 ##
323 ## Allow querying socket state, subject to capability rights.
324 ##
325 ## XXXRW: getsockopt(2) may need more attention.
326 ##
327 getsockname
328 getsockopt
329
330 ##
331 ## Allow querying the global clock.
332 ##
333 gettimeofday
334
335 ##
336 ## Allow querying current process credential state.
337 ##
338 getuid
339
340 ##
341 ## Allow ioctl(2), which hopefully will be limited by applications only to
342 ## required commands with cap_ioctls_limit(2) syscall.
343 ##
344 ioctl
345
346 ##
347 ## Allow querying current process credential state.
348 ##
349 issetugid
350
351 ##
352 ## Allow kevent(2), as we will authorize based on capability rights on the
353 ## target descriptor.
354 ##
355 kevent
356
357 ##
358 ## Allow kill(2), as we allow the process to send signals only to himself.
359 ##
360 kill
361
362 ##
363 ## Allow message queue operations on file descriptors, subject to capability
364 ## rights.
365 ## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with
366 ## SYF_CAPENABLED.
367 ##
368 kmq_notify
369 kmq_setattr
370 kmq_timedreceive
371 kmq_timedsend
372
373 ##
374 ## Allow kqueue(2), we will control use.
375 ##
376 kqueue
377
378 ##
379 ## Allow managing per-process timers.
380 ##
381 ktimer_create
382 ktimer_delete
383 ktimer_getoverrun
384 ktimer_gettime
385 ktimer_settime
386
387 ##
388 ## We can't allow ktrace(2) because it relies on a global namespace, but we
389 ## might want to introduce an fktrace(2) of some sort.
390 ##
391 #ktrace
392
393 ##
394 ## Allow AIO operations by file descriptor, subject to capability rights.
395 ##
396 lio_listio
397
398 ##
399 ## Allow listen(2), subject to capability rights.
400 ##
401 ## XXXRW: One might argue this manipulates a global namespace.
402 ##
403 listen
404
405 ##
406 ## Allow I/O-related file descriptors, subject to capability rights.
407 ##
408 lseek
409
410 ##
411 ## Allow simple VM operations on the current process.
412 ##
413 madvise
414 mincore
415 minherit
416 mlock
417 mlockall
418
419 ##
420 ## Allow memory mapping a file descriptor, and updating protections, subject
421 ## to capability rights.
422 ##
423 mmap
424 mprotect
425
426 ##
427 ## Allow simple VM operations on the current process.
428 ##
429 msync
430 munlock
431 munlockall
432 munmap
433
434 ##
435 ## Allow the current process to sleep.
436 ##
437 nanosleep
438
439 ##
440 ## Allow querying the global clock.
441 ##
442 ntp_gettime
443
444 ##
445 ## Allow AIO operations by file descriptor, subject to capability rights.
446 ##
447 oaio_read
448 oaio_write
449
450 ##
451 ## Allow simple VM operations on the current process.
452 ##
453 break
454
455 ##
456 ## Allow AIO operations by file descriptor, subject to capability rights.
457 ##
458 olio_listio
459
460 ##
461 ## Operations relative to directory capabilities.
462 ##
463 chflagsat
464 faccessat
465 fchmodat
466 fchownat
467 fstatat
468 futimesat
469 linkat
470 mkdirat
471 mkfifoat
472 mknodat
473 openat
474 readlinkat
475 renameat
476 symlinkat
477 unlinkat
478 funlinkat
479 utimensat
480
481 ##
482 ## Process descriptor-related system calls are allowed.
483 ##
484 pdfork
485 pdgetpid
486 pdkill
487 #pdwait4        # not yet implemented
488
489 ##
490 ## Allow pipe(2).
491 ##
492 pipe
493 pipe2
494
495 ##
496 ## Allow poll(2), which will be scoped by capability rights.
497 ##
498 poll
499 ppoll
500
501 ##
502 ## Allow I/O-related file descriptors, subject to capability rights.
503 ##
504 posix_fallocate
505 pread
506 preadv
507
508 ##
509 ## Allow access to profiling state on the current process.
510 ##
511 profil
512
513 ##
514 ## Disallow ptrace(2) for now, but we do need debugging facilities in
515 ## capability mode, so we will want to revisit this, possibly by scoping its
516 ## operation.
517 ##
518 #ptrace
519
520 ##
521 ## Allow I/O-related file descriptors, subject to capability rights.
522 ##
523 pwrite
524 pwritev
525 read
526 readv
527 recv
528 recvfrom
529 recvmsg
530
531 ##
532 ## Allow real-time scheduling primitives to be used.
533 ##
534 ## XXXRW: These require scoping.
535 ##
536 rtprio
537 rtprio_thread
538
539 ##
540 ## Allow simple VM operations on the current process.
541 ##
542 sbrk
543
544 ##
545 ## Allow querying trivial global scheduler state.
546 ##
547 sched_get_priority_max
548 sched_get_priority_min
549
550 ##
551 ## Allow various thread/process scheduler operations.
552 ##
553 ## XXXRW: Some of these require further scoping.
554 ##
555 sched_getparam
556 sched_getscheduler
557 sched_rr_get_interval
558 sched_setparam
559 sched_setscheduler
560 sched_yield
561
562 ##
563 ## Allow I/O-related file descriptors, subject to capability rights.
564 ## NOTE: Corresponding sysents are initialized in sys/netinet/sctp_syscalls.c
565 ## with SYF_CAPENABLED.
566 ##
567 sctp_generic_recvmsg
568 sctp_generic_sendmsg
569 sctp_generic_sendmsg_iov
570 sctp_peeloff
571
572 ##
573 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
574 ##
575 ## XXXRW: But is it?
576 ##
577 pselect
578 select
579
580 ##
581 ## Allow I/O-related file descriptors, subject to capability rights.  Use of
582 ## explicit addresses here is restricted by the system calls themselves.
583 ##
584 send
585 sendfile
586 sendmsg
587 sendto
588
589 ##
590 ## Allow setting per-process audit state, which is controlled separately by
591 ## privileges.
592 ##
593 setaudit
594 setaudit_addr
595 setauid
596
597 ##
598 ## Allow setting thread context.
599 ##
600 setcontext
601
602 ##
603 ## Allow setting current process credential state, which is controlled
604 ## separately by privilege.
605 ##
606 setegid
607 seteuid
608 setgid
609
610 ##
611 ## Allow use of the process interval timer.
612 ##
613 setitimer
614
615 ##
616 ## Allow setpriority(2).
617 ##
618 ## XXXRW: Requires scoping.
619 ##
620 setpriority
621
622 ##
623 ## Allow setting current process credential state, which is controlled
624 ## separately by privilege.
625 ##
626 setregid
627 setresgid
628 setresuid
629 setreuid
630
631 ##
632 ## Allow setting process resource limits with setrlimit(2).
633 ##
634 setrlimit
635
636 ##
637 ## Allow creating a new session with setsid(2).
638 ##
639 setsid
640
641 ##
642 ## Allow setting socket options with setsockopt(2), subject to capability
643 ## rights.
644 ##
645 ## XXXRW: Might require scoping.
646 ##
647 setsockopt
648
649 ##
650 ## Allow setting current process credential state, which is controlled
651 ## separately by privilege.
652 ##
653 setuid
654
655 ##
656 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
657 ##
658 shm_open
659 shm_open2
660
661 ##
662 ## Allow I/O-related file descriptors, subject to capability rights.
663 ##
664 shutdown
665
666 ##
667 ## Allow signal control on current process.
668 ##
669 sigaction
670 sigaltstack
671 sigblock
672 sigfastblock
673 sigpending
674 sigprocmask
675 sigqueue
676 sigreturn
677 sigsetmask
678 sigstack
679 sigsuspend
680 sigtimedwait
681 sigvec
682 sigwaitinfo
683 sigwait
684
685 ##
686 ## Allow creating new socket pairs with socket(2) and socketpair(2).
687 ##
688 socket
689 socketpair
690
691 ##
692 ## Allow simple VM operations on the current process.
693 ##
694 ## XXXRW: Kernel doesn't implement this, so drop?
695 ##
696 sstk
697
698 ##
699 ## Do allow sync(2) for now, but possibly shouldn't.
700 ##
701 sync
702
703 ##
704 ## Always allow process termination with sys_exit(2).
705 ##
706 sys_exit
707
708 ##
709 ## sysarch(2) does rather diverse things, but is required on at least i386
710 ## in order to configure per-thread data.  As such, it's scoped on each
711 ## architecture.
712 ##
713 sysarch
714
715 ##
716 ## Allow thread operations operating only on current process.
717 ##
718 thr_create
719 thr_exit
720 thr_kill
721
722 ##
723 ## Disallow thr_kill2(2), as it may operate beyond the current process.
724 ##
725 ## XXXRW: Requires scoping.
726 ##
727 #thr_kill2
728
729 ##
730 ## Allow thread operations operating only on current process.
731 ##
732 thr_new
733 thr_self
734 thr_set_name
735 thr_suspend
736 thr_wake
737
738 ##
739 ## Allow manipulation of the current process umask with umask(2).
740 ##
741 umask
742
743 ##
744 ## Allow submitting of process trace entries with utrace(2).
745 ##
746 utrace
747
748 ##
749 ## Allow generating UUIDs with uuidgen(2).
750 ##
751 uuidgen
752
753 ##
754 ## Allow I/O-related file descriptors, subject to capability rights.
755 ##
756 write
757 writev
758
759 ##
760 ## Allow processes to yield(2).
761 ##
762 yield