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