]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man7/capabilities.7
capabilities.7: Document the 'no_file_caps' kernel command-line option
[thirdparty/man-pages.git] / man7 / capabilities.7
CommitLineData
c11b1abf 1.\" Copyright (c) 2002 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
10d76543
MK
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
fea681da
MK
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" 6 Aug 2002 - Initial Creation
c11b1abf
MK
26.\" Modified 2003-05-23, Michael Kerrisk, <mtk.manpages@gmail.com>
27.\" Modified 2004-05-27, Michael Kerrisk, <mtk.manpages@gmail.com>
1c1e15ed 28.\" 2004-12-08, mtk Added O_NOATIME for CAP_FOWNER
5eaee3d9 29.\" 2005-08-16, mtk, Added CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE
c8e68512
MK
30.\" 2008-07-15, Serge Hallyn <serue@us.bbm.com>
31.\" Document file capabilities, per-process capability
32.\" bounding set, changed semantics for CAP_SETPCAP,
33.\" and other changes in 2.6.2[45].
34.\" Add CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_SETFCAP.
35.\" 2008-07-15, mtk
36.\" Add text describing circumstances in which CAP_SETPCAP
37.\" (theoretically) permits a thread to change the
38.\" capability sets of another thread.
39.\" Add section describing rules for programmatically
40.\" adjusting thread capability sets.
41.\" Describe rationale for capability bounding set.
42.\" Document "securebits" flags.
43.\" Add text noting that if we set the effective flag for one file
44.\" capability, then we must also set the effective flag for all
45.\" other capabilities where the permitted or inheritable bit is set.
bfb730f9 46.\" 2011-09-07, mtk/Serge hallyn: Add CAP_SYSLOG
5eaee3d9 47.\"
8538a62b 48.TH CAPABILITIES 7 2018-02-02 "Linux" "Linux Programmer's Manual"
fea681da
MK
49.SH NAME
50capabilities \- overview of Linux capabilities
51.SH DESCRIPTION
fea681da 52For the purpose of performing permission checks,
008f1ecc 53traditional UNIX implementations distinguish two categories of processes:
fea681da
MK
54.I privileged
55processes (whose effective user ID is 0, referred to as superuser or root),
56and
57.I unprivileged
c7094399 58processes (whose effective UID is nonzero).
fea681da
MK
59Privileged processes bypass all kernel permission checks,
60while unprivileged processes are subject to full permission
61checking based on the process's credentials
62(usually: effective UID, effective GID, and supplementary group list).
ade303d7 63.PP
c13182ef
MK
64Starting with kernel 2.2, Linux divides the privileges traditionally
65associated with superuser into distinct units, known as
fea681da 66.IR capabilities ,
3dfe7e0d 67which can be independently enabled and disabled.
cf7a13d4 68Capabilities are a per-thread attribute.
c8e68512 69.\"
c634028a 70.SS Capabilities list
c8e68512
MK
71The following list shows the capabilities implemented on Linux,
72and the operations or behaviors that each capability permits:
fea681da 73.TP
45286787 74.BR CAP_AUDIT_CONTROL " (since Linux 2.6.11)"
5eaee3d9
MK
75Enable and disable kernel auditing; change auditing filter rules;
76retrieve auditing status and filtering rules.
77.TP
c81cea2c
MK
78.BR CAP_AUDIT_READ " (since Linux 3.16)"
79.\" commit a29b694aa1739f9d76538e34ae25524f9c549d59
80.\" commit 3a101b8de0d39403b2c7e5c23fd0b005668acf48
81Allow reading the audit log via a multicast netlink socket.
82.TP
45286787 83.BR CAP_AUDIT_WRITE " (since Linux 2.6.11)"
c8e68512 84Write records to kernel auditing log.
5eaee3d9 85.TP
9339d749
MK
86.BR CAP_BLOCK_SUSPEND " (since Linux 3.5)"
87Employ features that can block system suspend
88.RB ( epoll (7)
89.BR EPOLLWAKEUP ,
90.IR /proc/sys/wake_lock ).
91.TP
fea681da 92.B CAP_CHOWN
c8e68512 93Make arbitrary changes to file UIDs and GIDs (see
fea681da
MK
94.BR chown (2)).
95.TP
96.B CAP_DAC_OVERRIDE
97Bypass file read, write, and execute permission checks.
c8e68512 98(DAC is an abbreviation of "discretionary access control".)
fea681da
MK
99.TP
100.B CAP_DAC_READ_SEARCH
a537062e
MK
101.PD 0
102.RS
103.IP * 2
fea681da 104Bypass file read permission checks and
a537062e
MK
105directory read and execute permission checks;
106.IP *
3bbab71a 107invoke
24ee13df
MK
108.BR open_by_handle_at (2);
109.IP *
110use the
111.BR linkat (2)
112.B AT_EMPTY_PATH
113flag to create a link to a file referred to by a file descriptor.
a537062e
MK
114.RE
115.PD
fea681da
MK
116.TP
117.B CAP_FOWNER
c8e68512
MK
118.PD 0
119.RS
120.IP * 2
fea681da 121Bypass permission checks on operations that normally
9ee4a2b6 122require the filesystem UID of the process to match the UID of
fea681da
MK
123the file (e.g.,
124.BR chmod (2),
125.BR utime (2)),
c8e68512 126excluding those operations covered by
fea681da
MK
127.B CAP_DAC_OVERRIDE
128and
129.BR CAP_DAC_READ_SEARCH ;
c8e68512 130.IP *
1dc9bca6
MK
131set inode flags (see
132.BR ioctl_iflags (2))
fea681da 133on arbitrary files;
c8e68512 134.IP *
fea681da 135set Access Control Lists (ACLs) on arbitrary files;
c8e68512 136.IP *
1c1e15ed 137ignore directory sticky bit on file deletion;
c8e68512 138.IP *
1c1e15ed
MK
139specify
140.B O_NOATIME
141for arbitrary files in
142.BR open (2)
143and
144.BR fcntl (2).
c8e68512
MK
145.RE
146.PD
fea681da
MK
147.TP
148.B CAP_FSETID
3bbab71a
MK
149.PD 0
150.RS
151.IP * 2
ed948c28 152Don't clear set-user-ID and set-group-ID mode
c8e68512 153bits when a file is modified;
3bbab71a 154.IP *
c8e68512 155set the set-group-ID bit for a file whose GID does not match
9ee4a2b6 156the filesystem or any of the supplementary GIDs of the calling process.
3bbab71a
MK
157.RE
158.PD
fea681da
MK
159.TP
160.B CAP_IPC_LOCK
bea08fec 161.\" FIXME . As at Linux 3.2, there are some strange uses of this capability
46c73a44 162.\" in other places; they probably should be replaced with something else.
c8e68512 163Lock memory
fea681da
MK
164.RB ( mlock (2),
165.BR mlockall (2),
166.BR mmap (2),
167.BR shmctl (2)).
168.TP
169.B CAP_IPC_OWNER
170Bypass permission checks for operations on System V IPC objects.
171.TP
172.B CAP_KILL
173Bypass permission checks for sending signals (see
174.BR kill (2)).
097585ed 175This includes use of the
c8e68512 176.BR ioctl (2)
097585ed 177.B KDSIGACCEPT
c8e68512 178operation.
bea08fec 179.\" FIXME . CAP_KILL also has an effect for threads + setting child
a7c1e564
MK
180.\" termination signal to other than SIGCHLD: without this
181.\" capability, the termination signal reverts to SIGCHLD
c13182ef 182.\" if the child does an exec(). What is the rationale
a7c1e564 183.\" for this?
fea681da 184.TP
c8e68512
MK
185.BR CAP_LEASE " (since Linux 2.4)"
186Establish leases on arbitrary files (see
fea681da
MK
187.BR fcntl (2)).
188.TP
189.B CAP_LINUX_IMMUTABLE
c8e68512
MK
190Set the
191.B FS_APPEND_FL
fea681da 192and
c8e68512 193.B FS_IMMUTABLE_FL
e7e006f2 194inode flags (see
1dc9bca6 195.BR ioctl_iflags (2)).
fea681da 196.TP
c8e68512 197.BR CAP_MAC_ADMIN " (since Linux 2.6.25)"
7f82d0b0 198Allow MAC configuration or state changes.
c8e68512
MK
199Implemented for the Smack Linux Security Module (LSM).
200.TP
201.BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)"
7f82d0b0 202Override Mandatory Access Control (MAC).
c8e68512
MK
203Implemented for the Smack LSM.
204.TP
205.BR CAP_MKNOD " (since Linux 2.4)"
206Create special files using
fea681da
MK
207.BR mknod (2).
208.TP
209.B CAP_NET_ADMIN
e87268ec
MK
210Perform various network-related operations:
211.PD 0
212.RS
213.IP * 2
214interface configuration;
215.IP *
12fe8fd3 216administration of IP firewall, masquerading, and accounting;
e87268ec
MK
217.IP *
218modify routing tables;
219.IP *
220bind to any address for transparent proxying;
221.IP *
222set type-of-service (TOS)
223.IP *
224clear driver statistics;
225.IP *
226set promiscuous mode;
227.IP *
228enabling multicasting;
229.IP *
230use
231.BR setsockopt (2)
232to set the following socket options:
233.BR SO_DEBUG ,
234.BR SO_MARK ,
235.BR SO_PRIORITY
236(for a priority outside the range 0 to 6),
237.BR SO_RCVBUFFORCE ,
238and
239.BR SO_SNDBUFFORCE .
240.RE
241.PD
fea681da
MK
242.TP
243.B CAP_NET_BIND_SERVICE
6eb334b2 244Bind a socket to Internet domain privileged ports
fea681da
MK
245(port numbers less than 1024).
246.TP
247.B CAP_NET_BROADCAST
c8e68512 248(Unused) Make socket broadcasts, and listen to multicasts.
fd39ef0c
MK
249.\" FIXME Since Linux 4.2, there are use cases for netlink sockets
250.\" commit 59324cf35aba5336b611074028777838a963d03b
fea681da
MK
251.TP
252.B CAP_NET_RAW
93e9e2d6
MK
253.PD 0
254.RS
255.IP * 2
dd55b8a1 256Use RAW and PACKET sockets;
93e9e2d6
MK
257.IP *
258bind to any address for transparent proxying.
259.RE
260.PD
fea681da
MK
261.\" Also various IP options and setsockopt(SO_BINDTODEVICE)
262.TP
263.B CAP_SETGID
3bbab71a
MK
264.RS
265.PD 0
266.IP * 2
c8e68512 267Make arbitrary manipulations of process GIDs and supplementary GID list;
3bbab71a 268.IP *
5bea231d 269forge GID when passing socket credentials via UNIX domain sockets;
3bbab71a 270.IP *
5bea231d 271write a group ID mapping in a user namespace (see
f58fb24f 272.BR user_namespaces (7)).
3bbab71a
MK
273.PD
274.RE
fea681da 275.TP
c8e68512 276.BR CAP_SETFCAP " (since Linux 2.6.24)"
b8cee784 277Set arbitrary capabilities on a file.
c8e68512
MK
278.TP
279.B CAP_SETPCAP
e62172cb 280If file capabilities are supported (i.e., since Linux 2.6.24):
c8e68512
MK
281add any capability from the calling thread's bounding set
282to its inheritable set;
283drop capabilities from the bounding set (via
284.BR prctl (2)
285.BR PR_CAPBSET_DROP );
286make changes to the
287.I securebits
288flags.
e62172cb
MK
289.IP
290If file capabilities are not supported (i.e., kernels before Linux 2.6.24):
291grant or remove any capability in the
292caller's permitted capability set to or from any other process.
293(This property of
294.B CAP_SETPCAP
295is not available when the kernel is configured to support
296file capabilities, since
297.B CAP_SETPCAP
298has entirely different semantics for such kernels.)
fea681da
MK
299.TP
300.B CAP_SETUID
3bbab71a
MK
301.RS
302.PD 0
303.IP * 2
c8e68512 304Make arbitrary manipulations of process UIDs
fea681da
MK
305.RB ( setuid (2),
306.BR setreuid (2),
307.BR setresuid (2),
308.BR setfsuid (2));
3bbab71a 309.IP *
a7d96776 310forge UID when passing socket credentials via UNIX domain sockets;
3bbab71a 311.IP *
5bea231d 312write a user ID mapping in a user namespace (see
f58fb24f 313.BR user_namespaces (7)).
3bbab71a
MK
314.PD
315.RE
777f5a9e 316.\" FIXME CAP_SETUID also an effect in exec(); document this.
fea681da
MK
317.TP
318.B CAP_SYS_ADMIN
fa50d3d4
MK
319.IR Note :
320this capability is overloaded; see
321.IR "Notes to kernel developers" ,
322below.
ade303d7 323.IP
c8e68512
MK
324.PD 0
325.RS
326.IP * 2
327Perform a range of system administration operations including:
fea681da
MK
328.BR quotactl (2),
329.BR mount (2),
330.BR umount (2),
1368e847
MK
331.BR swapon (2),
332.BR swapoff (2),
fea681da 333.BR sethostname (2),
f169a862 334and
c8e68512
MK
335.BR setdomainname (2);
336.IP *
bfb730f9
MK
337perform privileged
338.BR syslog (2)
339operations (since Linux 2.6.37,
340.BR CAP_SYSLOG
341should be used to permit such operations);
342.IP *
c8e68512 343perform
c11e3891
MK
344.B VM86_REQUEST_IRQ
345.BR vm86 (2)
346command;
347.IP *
348perform
fea681da
MK
349.B IPC_SET
350and
351.B IPC_RMID
352operations on arbitrary System V IPC objects;
c8e68512 353.IP *
1a3b63f7
MK
354override
355.B RLIMIT_NPROC
356resource limit;
357.IP *
fea681da
MK
358perform operations on
359.I trusted
360and
361.I security
362Extended Attributes (see
89fabe2e 363.BR xattr (7));
c8e68512
MK
364.IP *
365use
08baa0af 366.BR lookup_dcookie (2);
c8e68512 367.IP *
a1f926b8
MK
368use
369.BR ioprio_set (2)
370to assign
371.B IOPRIO_CLASS_RT
83ee9237 372and (before Linux 2.6.25)
237aa7c5 373.B IOPRIO_CLASS_IDLE
a1f926b8 374I/O scheduling classes;
c8e68512 375.IP *
f5ac5bbf 376forge PID when passing socket credentials via UNIX domain sockets;
c8e68512 377.IP *
fea681da 378exceed
3dfe7e0d
MK
379.IR /proc/sys/fs/file-max ,
380the system-wide limit on the number of open files,
381in system calls that open files (e.g.,
fea681da
MK
382.BR accept (2),
383.BR execve (2),
384.BR open (2),
f169a862 385.BR pipe (2));
c8e68512 386.IP *
c13182ef 387employ
0f807eea
MK
388.B CLONE_*
389flags that create new namespaces with
a7c1e564
MK
390.BR clone (2)
391and
c67d3814
MK
392.BR unshare (2)
393(but, since Linux 3.8,
394creating user namespaces does not require any capability);
c8e68512 395.IP *
e4698850 396call
0f322ccc
MK
397.BR perf_event_open (2);
398.IP *
0f322ccc
MK
399access privileged
400.I perf
401event information;
2bfe6656
MK
402.IP *
403call
c3b49118
MK
404.BR setns (2)
405(requires
406.B CAP_SYS_ADMIN
407in the
408.I target
409namespace);
e4698850 410.IP *
0f807eea
MK
411call
412.BR fanotify_init (2);
413.IP *
0563f204
MK
414call
415.BR bpf (2);
416.IP *
2cf45b0d 417perform privileged
a7c1e564
MK
418.B KEYCTL_CHOWN
419and
420.B KEYCTL_SETPERM
421.BR keyctl (2)
e64e6056
MK
422operations;
423.IP *
424perform
425.BR madvise (2)
426.B MADV_HWPOISON
0f807eea
MK
427operation;
428.IP *
429employ the
430.B TIOCSTI
431.BR ioctl (2)
432to insert characters into the input queue of a terminal other than
838ad419 433the caller's controlling terminal;
0f807eea 434.IP *
0f807eea 435employ the obsolete
51c5c662 436.BR nfsservctl (2)
c42221c4
MK
437system call;
438.IP *
439employ the obsolete
0f807eea
MK
440.BR bdflush (2)
441system call;
442.IP *
443perform various privileged block-device
444.BR ioctl (2)
445operations;
446.IP *
9ee4a2b6 447perform various privileged filesystem
0f807eea
MK
448.BR ioctl (2)
449operations;
450.IP *
fdf41f57
MK
451perform privileged
452.BR ioctl (2)
453operations on the
454.IR /dev/random
455device (see
456.BR random (4));
457.IP *
c6ddae52
MK
458install a
459.BR seccomp (2)
460filter without first having to set the
461.I no_new_privs
462thread attribute;
463.IP *
968b27aa
MK
464modify allow/deny rules for device control groups;
465.IP *
466employ the
467.BR ptrace (2)
468.B PTRACE_SECCOMP_GET_FILTER
469operation to dump tracee's seccomp filters;
470.IP *
471employ the
472.BR ptrace (2)
473.B PTRACE_SETOPTIONS
474operation to suspend the tracee's seccomp protections (i.e., the
475.B PTRACE_O_SUSPEND_SECCOMP
115c1eb4 476flag);
c6ddae52 477.IP *
0f807eea 478perform administrative operations on many device drivers.
c8e68512
MK
479.RE
480.PD
fea681da
MK
481.TP
482.B CAP_SYS_BOOT
c8e68512 483Use
08baa0af
MK
484.BR reboot (2)
485and
486.BR kexec_load (2).
fea681da
MK
487.TP
488.B CAP_SYS_CHROOT
c8e68512 489Use
fea681da 490.BR chroot (2).
68ea3ce6 491.\" FIXME . There is a use case in mntns_install()
fea681da
MK
492.TP
493.B CAP_SYS_MODULE
3bbab71a
MK
494.RS
495.PD 0
496.IP * 2
c8e68512
MK
497Load and unload kernel modules
498(see
fea681da
MK
499.BR init_module (2)
500and
c8e68512 501.BR delete_module (2));
3bbab71a 502.IP *
c8e68512
MK
503in kernels before 2.6.25:
504drop capabilities from the system-wide capability bounding set.
3bbab71a
MK
505.PD
506.RE
fea681da
MK
507.TP
508.B CAP_SYS_NICE
c8e68512
MK
509.PD 0
510.RS
511.IP * 2
512Raise process nice value
fea681da
MK
513.RB ( nice (2),
514.BR setpriority (2))
c8e68512
MK
515and change the nice value for arbitrary processes;
516.IP *
517set real-time scheduling policies for calling process,
518and set scheduling policies and priorities for arbitrary processes
fea681da 519.RB ( sched_setscheduler (2),
f96787ab 520.BR sched_setparam (2),
0d59d0c8 521.BR sched_setattr (2));
c8e68512 522.IP *
fea681da 523set CPU affinity for arbitrary processes
c13182ef 524.RB ( sched_setaffinity (2));
c8e68512 525.IP *
a1f926b8 526set I/O scheduling class and priority for arbitrary processes
c13182ef 527.RB ( ioprio_set (2));
c8e68512
MK
528.IP *
529apply
a1f926b8 530.BR migrate_pages (2)
c8e68512 531to arbitrary processes and allow processes
a1f926b8 532to be migrated to arbitrary nodes;
c13182ef 533.\" FIXME CAP_SYS_NICE also has the following effect for
a1f926b8
MK
534.\" migrate_pages(2):
535.\" do_migrate_pages(mm, &old, &new,
536.\" capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
1a0fbe37 537.\"
bea08fec 538.\" Document this.
c8e68512
MK
539.IP *
540apply
a7c1e564 541.BR move_pages (2)
c8e68512
MK
542to arbitrary processes;
543.IP *
4d62f7b6
MK
544use the
545.B MPOL_MF_MOVE_ALL
c13182ef 546flag with
a7c1e564 547.BR mbind (2)
c13182ef 548and
a7c1e564 549.BR move_pages (2).
c8e68512
MK
550.RE
551.PD
fea681da
MK
552.TP
553.B CAP_SYS_PACCT
c8e68512 554Use
fea681da
MK
555.BR acct (2).
556.TP
557.B CAP_SYS_PTRACE
eb64a9cb
MK
558.PD 0
559.RS
de6a5c05 560.IP * 2
c8e68512 561Trace arbitrary processes using
cbd7b9bf 562.BR ptrace (2);
eb64a9cb 563.IP *
cbd7b9bf
MK
564apply
565.BR get_robust_list (2)
38b6e5b0 566to arbitrary processes;
eb64a9cb 567.IP *
b8f84ce2
MK
568transfer data to or from the memory of arbitrary processes using
569.BR process_vm_readv (2)
570and
3bbab71a 571.BR process_vm_writev (2);
b8f84ce2 572.IP *
38b6e5b0
MK
573inspect processes using
574.BR kcmp (2).
eb64a9cb
MK
575.RE
576.PD
fea681da
MK
577.TP
578.B CAP_SYS_RAWIO
4637c8cb
MK
579.PD 0
580.RS
581.IP * 2
c8e68512 582Perform I/O port operations
fea681da
MK
583.RB ( iopl (2)
584and
585.BR ioperm (2));
4637c8cb 586.IP *
fea681da 587access
474e1f9d 588.IR /proc/kcore ;
4637c8cb 589.IP *
474e1f9d
MK
590employ the
591.B FIBMAP
592.BR ioctl (2)
4637c8cb
MK
593operation;
594.IP *
595open devices for accessing x86 model-specific registers (MSRs, see
3bbab71a 596.BR msr (4));
4637c8cb
MK
597.IP *
598update
599.IR /proc/sys/vm/mmap_min_addr ;
600.IP *
601create memory mappings at addresses below the value specified by
602.IR /proc/sys/vm/mmap_min_addr ;
603.IP *
50b2aa27 604map files in
cef53f3e 605.IR /proc/bus/pci ;
4637c8cb
MK
606.IP *
607open
608.IR /dev/mem
609and
610.IR /dev/kmem ;
611.IP *
612perform various SCSI device commands;
613.IP *
614perform certain operations on
615.BR hpsa (4)
616and
617.BR cciss (4)
618devices;
619.IP *
620perform a range of device-specific operations on other devices.
621.RE
622.PD
fea681da
MK
623.TP
624.B CAP_SYS_RESOURCE
c8e68512
MK
625.PD 0
626.RS
627.IP * 2
9ee4a2b6 628Use reserved space on ext2 filesystems;
c8e68512
MK
629.IP *
630make
fea681da
MK
631.BR ioctl (2)
632calls controlling ext3 journaling;
c8e68512
MK
633.IP *
634override disk quota limits;
635.IP *
636increase resource limits (see
fea681da 637.BR setrlimit (2));
c8e68512
MK
638.IP *
639override
fea681da 640.B RLIMIT_NPROC
c8e68512
MK
641resource limit;
642.IP *
aa66392d
MK
643override maximum number of consoles on console allocation;
644.IP *
645override maximum number of keymaps;
646.IP *
647allow more than 64hz interrupts from the real-time clock;
648.IP *
c8e68512 649raise
fea681da 650.I msg_qbytes
c8e68512 651limit for a System V message queue above the limit in
0daa9e92 652.I /proc/sys/kernel/msgmnb
fea681da
MK
653(see
654.BR msgop (2)
655and
ad7b0f91
MK
656.BR msgctl (2));
657.IP *
7509f758
MK
658allow the
659.B RLIMIT_NOFILE
660resource limit on the number of "in-flight" file descriptors
661to be bypassed when passing file descriptors to another process
662via a UNIX domain socket (see
663.BR unix (7));
664.IP *
ad7b0f91
MK
665override the
666.I /proc/sys/fs/pipe-size-max
667limit when setting the capacity of a pipe using the
668.B F_SETPIPE_SZ
669.BR fcntl (2)
670command.
46883521
MK
671.IP *
672use
673.BR F_SETPIPE_SZ
674to increase the capacity of a pipe above the limit specified by
b39a2012
MK
675.IR /proc/sys/fs/pipe-max-size ;
676.IP *
677override
678.I /proc/sys/fs/mqueue/queues_max
679limit when creating POSIX message queues (see
ecc1f45b
MK
680.BR mq_overview (7));
681.IP *
3bbab71a 682employ the
ecc1f45b
MK
683.BR prctl (2)
684.B PR_SET_MM
8ddcc591 685operation;
41f00272 686.IP *
8ddcc591 687set
750653a8 688.IR /proc/[pid]/oom_score_adj
8ddcc591
MK
689to a value lower than the value last set by a process with
690.BR CAP_SYS_RESOURCE .
c8e68512
MK
691.RE
692.PD
fea681da
MK
693.TP
694.B CAP_SYS_TIME
c8e68512 695Set system clock
fea681da
MK
696.RB ( settimeofday (2),
697.BR stime (2),
698.BR adjtimex (2));
c8e68512 699set real-time (hardware) clock.
fea681da
MK
700.TP
701.B CAP_SYS_TTY_CONFIG
c8e68512 702Use
749ac769
MK
703.BR vhangup (2);
704employ various privileged
705.BR ioctl (2)
706operations on virtual terminals.
bfb730f9
MK
707.TP
708.BR CAP_SYSLOG " (since Linux 2.6.37)"
5f94327c
MK
709.RS
710.PD 0
de6a5c05 711.IP * 2
bfb730f9
MK
712Perform privileged
713.BR syslog (2)
714operations.
715See
716.BR syslog (2)
717for information on which operations require privilege.
10fe5485
MK
718.IP *
719View kernel addresses exposed via
720.I /proc
721and other interfaces when
722.IR /proc/sys/kernel/kptr_restrict
723has the value 1.
4eaa04c5 724(See the discussion of the
10fe5485
MK
725.I kptr_restrict
726in
727.BR proc (5).)
5f94327c
MK
728.PD
729.RE
d6b08708
MK
730.TP
731.BR CAP_WAKE_ALARM " (since Linux 3.0)"
732Trigger something that will wake up the system (set
733.B CLOCK_REALTIME_ALARM
734and
735.B CLOCK_BOOTTIME_ALARM
736timers).
c8e68512 737.\"
c634028a 738.SS Past and current implementation
c8e68512
MK
739A full implementation of capabilities requires that:
740.IP 1. 3
741For all privileged operations,
742the kernel must check whether the thread has the required
743capability in its effective set.
744.IP 2.
137d81b5 745The kernel must provide system calls allowing a thread's capability sets to
c8e68512
MK
746be changed and retrieved.
747.IP 3.
9ee4a2b6 748The filesystem must support attaching capabilities to an executable file,
c8e68512
MK
749so that a process gains those capabilities when the file is executed.
750.PP
751Before kernel 2.6.24, only the first two of these requirements are met;
752since kernel 2.6.24, all three requirements are met.
753.\"
8de5616f
MK
754.SS Notes to kernel developers
755When adding a new kernel feature that should be governed by a capability,
756consider the following points.
757.IP * 3
ddb624a9
MK
758The goal of capabilities is divide the power of superuser into pieces,
759such that if a program that has one or more capabilities is compromised,
760its power to do damage to the system would be less than the same program
761running with root privilege.
8de5616f
MK
762.IP *
763You have the choice of either creating a new capability for your new feature,
764or associating the feature with one of the existing capabilities.
ddb624a9 765In order to keep the set of capabilities to a manageable size,
8de5616f
MK
766the latter option is preferable,
767unless there are compelling reasons to take the former option.
ddb624a9
MK
768(There is also a technical limit:
769the size of capability sets is currently limited to 64 bits.)
8de5616f
MK
770.IP *
771To determine which existing capability might best be associated
772with your new feature, review the list of capabilities above in order
773to find a "silo" into which your new feature best fits.
ddb624a9
MK
774One approach to take is to determine if there are other features
775requiring capabilities that will always be use along with the new feature.
776If the new feature is useless without these other features,
777you should use the same capability as the other features.
8de5616f
MK
778.IP *
779.IR Don't
780choose
781.B CAP_SYS_ADMIN
782if you can possibly avoid it!
783A vast proportion of existing capability checks are associated
6e9219f7
MK
784with this capability (see the partial list above).
785It can plausibly be called "the new root",
786since on the one hand, it confers a wide range of powers,
787and on the other hand,
788its broad scope means that this is the capability
789that is required by many privileged programs.
8de5616f
MK
790Don't make the problem worse.
791The only new features that should be associated with
792.B CAP_SYS_ADMIN
793are ones that
794.I closely
795match existing uses in that silo.
796.IP *
797If you have determined that it really is necessary to create
798a new capability for your feature,
ddb624a9 799don't make or name it as a "single-use" capability.
8de5616f 800Thus, for example, the addition of the highly specific
42dfc34c 801.BR CAP_SYS_PACCT
8de5616f
MK
802was probably a mistake.
803Instead, try to identify and name your new capability as a broader
804silo into which other related future use cases might fit.
805.\"
c634028a 806.SS Thread capability sets
1db1d36d 807Each thread has the following capability sets containing zero or more
fea681da
MK
808of the above capabilities:
809.TP
c2b279af 810.IR Permitted
c8e68512
MK
811This is a limiting superset for the effective
812capabilities that the thread may assume.
813It is also a limiting superset for the capabilities that
814may be added to the inheritable set by a thread that does not have the
815.B CAP_SETPCAP
816capability in its effective set.
ade303d7 817.IP
cf7a13d4 818If a thread drops a capability from its permitted set,
3b777aff 819it can never reacquire that capability (unless it
c930827f 820.BR execve (2)s
c8e68512
MK
821either a set-user-ID-root program, or
822a program whose associated file capabilities grant that capability).
fea681da 823.TP
c2b279af 824.IR Inheritable
c8e68512 825This is a set of capabilities preserved across an
fea681da 826.BR execve (2).
6260f4cd
AL
827Inheritable capabilities remain inheritable when executing any program,
828and inheritable capabilities are added to the permitted set when executing
829a program that has the corresponding bits set in the file inheritable set.
830.IP
831Because inheritable capabilities are not generally preserved across
832.BR execve (2)
833when running as a non-root user, applications that wish to run helper
e574dcd0
MK
834programs with elevated capabilities should consider using
835ambient capabilities, described below.
c8e68512 836.TP
c2b279af 837.IR Effective
c8e68512
MK
838This is the set of capabilities used by the kernel to
839perform permission checks for the thread.
6260f4cd 840.TP
36de80b9
MK
841.IR Bounding " (per-thread since Linux 2.6.25)"
842The capability bounding set is a mechanism that can be used
843to limit the capabilities that are gained during
844.BR execve (2).
845.IP
846Since Linux 2.6.25, this is a per-thread capability set.
847In older kernels, the capability bounding set was a system wide attribute
848shared by all threads on the system.
849.IP
850.IP
851For more details on the capability bounding set, see below.
852.TP
c2b279af 853.IR Ambient " (since Linux 4.3)"
e574dcd0 854.\" commit 58319057b7847667f0c9585b9de0e8932b0fdb08
6260f4cd
AL
855This is a set of capabilities that are preserved across an
856.BR execve (2)
3375bef1 857of a program that is not privileged.
e574dcd0
MK
858The ambient capability set obeys the invariant that no capability
859can ever be ambient if it is not both permitted and inheritable.
ade303d7 860.IP
3375bef1
MK
861The ambient capability set can be directly modified using
862.BR prctl (2).
863Ambient capabilities are automatically lowered if either of
864the corresponding permitted or inheritable capabilities is lowered.
ade303d7 865.IP
3375bef1
MK
866Executing a program that changes UID or GID due to the
867set-user-ID or set-group-ID bits or executing a program that has
868any file capabilities set will clear the ambient set.
869Ambient capabilities are added to the permitted set and
870assigned to the effective set when
6260f4cd 871.BR execve (2)
e574dcd0 872is called.
5367a9ab
MK
873If ambient capabilities cause a process's permitted and effective
874capabilities to increase during an
875.BR execve (2),
876this does not trigger the secure-execution mode described in
877.BR ld.so (8).
fea681da 878.PP
fea681da
MK
879A child created via
880.BR fork (2)
881inherits copies of its parent's capability sets.
3dfe7e0d 882See below for a discussion of the treatment of capabilities during
c930827f 883.BR execve (2).
fea681da
MK
884.PP
885Using
886.BR capset (2),
c8e68512 887a thread may manipulate its own capability sets (see below).
afae50e4
MK
888.PP
889Since Linux 3.2, the file
890.I /proc/sys/kernel/cap_last_cap
a60b1f03 891.\" commit 73efc0394e148d0e15583e13712637831f926720
afae50e4
MK
892exposes the numerical value of the highest capability
893supported by the running kernel;
894this can be used to determine the highest bit
895that may be set in a capability set.
c8e68512 896.\"
c634028a 897.SS File capabilities
c8e68512
MK
898Since kernel 2.6.24, the kernel supports
899associating capability sets with an executable file using
900.BR setcap (8).
901The file capability sets are stored in an extended attribute (see
6a65cff8
MK
902.BR setxattr (2)
903and
904.BR xattr (7))
c8e68512
MK
905named
906.IR "security.capability" .
907Writing to this extended attribute requires the
908.BR CAP_SETFCAP
fea681da 909capability.
c8e68512 910The file capability sets,
cf7a13d4 911in conjunction with the capability sets of the thread,
c8e68512 912determine the capabilities of a thread after an
c930827f 913.BR execve (2).
ade303d7 914.PP
c8e68512 915The three file capability sets are:
fea681da 916.TP
3dfe7e0d 917.IR Permitted " (formerly known as " forced ):
c8e68512 918These capabilities are automatically permitted to the thread,
cf7a13d4 919regardless of the thread's inheritable capabilities.
fea681da 920.TP
c8e68512
MK
921.IR Inheritable " (formerly known as " allowed ):
922This set is ANDed with the thread's inheritable set to determine which
923inheritable capabilities are enabled in the permitted set of
924the thread after the
925.BR execve (2).
926.TP
fea681da 927.IR Effective :
c8e68512
MK
928This is not a set, but rather just a single bit.
929If this bit is set, then during an
930.BR execve (2)
931all of the new permitted capabilities for the thread are
932also raised in the effective set.
933If this bit is not set, then after an
934.BR execve (2),
935none of the new permitted capabilities is in the new effective set.
ade303d7 936.IP
c8e68512 937Enabling the file effective capability bit implies
2914a14d 938that any file permitted or inheritable capability that causes a
c8e68512
MK
939thread to acquire the corresponding permitted capability during an
940.BR execve (2)
e33a08e1 941(see the transformation rules described below) will also acquire that
c8e68512
MK
942capability in its effective set.
943Therefore, when assigning capabilities to a file
944.RB ( setcap (8),
945.BR cap_set_file (3),
946.BR cap_set_fd (3)),
947if we specify the effective flag as being enabled for any capability,
948then the effective flag must also be specified as enabled
949for all other capabilities for which the corresponding permitted or
950inheritable flags is enabled.
951.\"
c281d050 952.SS File capability extended attribute versioning
b6848704
MK
953To allow extensibility,
954the kernel supports a scheme to encode a version number inside the
955.I security.capability
956extended attribute that is used to implement file capabilities.
957These version numbers are internal to the implementation,
958and not directly visible to user-space applications.
959To date, the following versions are supported:
960.TP
961.BR VFS_CAP_REVISION_1
962This was the original file capability implementation,
963which supported 32-bit masks for file capabilities.
964.TP
965.BR VFS_CAP_REVISION_2 " (since Linux 2.6.25)"
966.\" commit e338d263a76af78fe8f38a72131188b58fceb591
967This version allows for file capability masks that are 64 bits in size,
968and was necessary as the number of supported capabilities grew beyond 32.
969The kernel transparently continues to support the execution of files
970that have 32-bit version 1 capability masks,
971but when adding capabilities to files that did not previously
972have capabilities, or modifying the capabilities of existing files,
bcaa30c9
MK
973it automatically uses the version 2 scheme
974(or possibly the version 3 scheme, as described below).
b6848704
MK
975.TP
976.BR VFS_CAP_REVISION_3 " (since Linux 4.14)"
977.\" commit 8db6c34f1dbc8e06aa016a9b829b06902c3e1340
bcaa30c9 978Version 3 file capabilities are provided
12dce731 979to support namespaced file capabilities (described below).
bcaa30c9 980.IP
b6848704 981As with version 2 file capabilities,
bcaa30c9
MK
982version 3 capability masks are 64 bits in size.
983But in addition, the root user ID of namespace is encoded in the
b6848704
MK
984.I security.capability
985extended attribute.
7da0c87a
MK
986(A namespace's root user ID is the value that user ID 0
987inside that namespace maps to in the initial user namespace.)
7b45f4b2 988.IP
bcaa30c9
MK
989Version 3 file capabilities are designed to coexist
990with version 2 capabilities;
991that is, on a modern Linux system,
992there may be some files with version 2 capabilities
993while others have version 3 capabilities.
994.PP
995Before Linux 4.14,
c281d050
MK
996the only kind of file capability extended attribute
997that could be attached to a file was a
bcaa30c9 998.B VFS_CAP_REVISION_2
c281d050 999attribute.
bcaa30c9 1000Since Linux 4.14,
9b2c207a 1001the version of the
bcaa30c9 1002.I security.capability
9b2c207a
MK
1003extended attribute that is attached to a file
1004depends on the circumstances in which the attribute was created.
bcaa30c9 1005.PP
7b45f4b2 1006Starting with Linux 4.14, a
7b45f4b2
MK
1007.I security.capability
1008extended attribute is automatically created as (or converted to)
bcaa30c9
MK
1009a version 3
1010.RB ( VFS_CAP_REVISION_3 )
1011attribute if both of the following are true:
7b45f4b2 1012.IP (1) 4
ffea2c14 1013The thread writing the attribute resides in a noninitial user namespace.
7b45f4b2
MK
1014(More precisely: the thread resides in a user namespace other
1015than the one from which the underlying filesystem was mounted.)
1016.IP (2)
1017The thread has the
1018.BR CAP_SETFCAP
1019capability over the file inode,
1020meaning that (a) the thread has the
1021.B CAP_SETFCAP
1022capability in its own user namespace;
1023and (b) the UID and GID of the file inode have mappings in
1024the writer's user namespace.
bcaa30c9 1025.PP
7b45f4b2
MK
1026When a
1027.BR VFS_CAP_REVISION_3
1028.I security.capability
1029extended attribute is created, the root user ID of the creating thread's
1030user namespace is saved in the extended attribute.
bcaa30c9 1031.PP
2c77e8de 1032By contrast, creating or modifying a
7b45f4b2
MK
1033.I security.capability
1034extended attribute from a privileged
1035.RB ( CAP_SETFCAP )
1036thread that resides in the
90ef0f7b 1037namespace where the underlying filesystem was mounted
7b45f4b2 1038(this normally means the initial user namespace)
2c77e8de 1039automatically results in the creation of a version 2
bcaa30c9 1040.RB ( VFS_CAP_REVISION_2 )
7b45f4b2 1041attribute.
bcaa30c9 1042.PP
2c77e8de
MK
1043Note that the creation of a version 3
1044.I security.capability
1045extended attribute is automatic.
1046That is to say, when a user-space application writes
1047.RB ( setxattr (2))
1048a
1049.I security.capability
1050attribute in the version 2 format,
1051the kernel will automatically create a version 3 attribute
1052if the attribute is created in the circumstances described above.
1053Correspondingly, when a version 3
1054.I security.capability
1055attribute is retrieved
1056.RB ( getxattr (2))
1057by a process that resides inside a user namespace that was created by the
1058root user ID (or a descendant of that user namespace),
1059the returned attribute is (automatically)
1060simplified to appear as a version 2 attribute
1061(i.e., the returned value is the size of a version 2 attribute and does
1062not include the root user ID).
1063These automatic translations mean that no changes are required to
1064user-space tools (e.g.,
1065.BR setcap (1)
1066and
1067.BR getcap (1))
1068in order for those tools to be used to create and retrieve version 3
1069.I security.capability
1070attributes.
1071.PP
bcaa30c9
MK
1072Note that a file can have either a version 2 or a version 3
1073.I security.capability
1074extended attribute associated with it, but not both:
1075creation or modification of the
1076.I security.capability
1077extended attribute will automatically modify the version
1078according to the circumstances in which the extended attribute is
1079created or modified.
b6848704 1080.\"
c634028a 1081.SS Transformation of capabilities during execve()
fea681da 1082.PP
c13182ef 1083During an
c930827f 1084.BR execve (2),
1e321034 1085the kernel calculates the new capabilities of
fea681da 1086the process using the following algorithm:
ade303d7 1087.PP
088a639b 1088.in +4n
b8302363 1089.EX
f04f131f 1090P'(ambient) = (file is privileged) ? 0 : P(ambient)
6260f4cd 1091
f04f131f 1092P'(permitted) = (P(inheritable) & F(inheritable)) |
2e87ced3 1093 (F(permitted) & P(bounding)) | P'(ambient)
fea681da 1094
f04f131f 1095P'(effective) = F(effective) ? P'(permitted) : P'(ambient)
fea681da 1096
5bdccabd 1097P'(inheritable) = P(inheritable) [i.e., unchanged]
2e87ced3
MK
1098
1099P'(bounding) = P(bounding) [i.e., unchanged]
b8302363 1100.EE
088a639b 1101.in
ade303d7 1102.PP
fea681da 1103where:
c8e68512 1104.RS 4
2e87ced3 1105.IP P() 6
c13182ef 1106denotes the value of a thread capability set before the
c930827f 1107.BR execve (2)
2e87ced3 1108.IP P'()
8295fc02 1109denotes the value of a thread capability set after the
c930827f 1110.BR execve (2)
2e87ced3 1111.IP F()
fea681da 1112denotes a file capability set
c8e68512 1113.RE
3375bef1 1114.PP
ddc1ad30
MK
1115Note the following details relating to the above capability
1116transformation rules:
1117.IP * 3
1118The ambient capability set is present only since Linux 4.3.
1119When determining the transformation of the ambient set during
1120.BR execve (2),
1121a privileged file is one that has capabilities or
3375bef1 1122has the set-user-ID or set-group-ID bit set.
ddc1ad30
MK
1123.IP *
1124Prior to Linux 2.6.25,
1125the bounding set was a system-wide attribute shared by all threads.
1126That system-wide value was employed to calculate the new permitted set during
1127.BR execve (2)
1128in the same manner as shown above for
1129.IR P(bounding) .
ade303d7 1130.PP
56cc88cb
MK
1131.IR Note :
1132the capability transitions described above may
1133.I not
ea121e3e 1134be performed (i.e., file capabilities may be ignored) for the same reasons
56cc88cb
MK
1135that the set-user-ID and set-group-ID bits are ignored; see
1136.BR execve (2).
f6acfeb8
MK
1137.IR Note :
1138if the kernel was booted with the
1139.I no_file_caps
1140option, then file capabilities are ignored (treated as empty)
1141during the capability transitions described above.
ade303d7 1142.PP
e3ed67ed
MK
1143.IR Note :
1144according to the rules above,
1145if a process with nonzero user IDs performs an
1146.BR execve (2)
1147then any capabilities that are present in
1148its permitted and effective sets will be cleared.
1149For the treatment of capabilities when a process with a
1150user ID of zero performs an
1151.BR execve (2),
1152see below under
1153.IR "Capabilities and execution of programs by root" .
c8e68512 1154.\"
e0e57837 1155.SS Safety checking for capability-dumb binaries
4a866754 1156A capability-dumb binary is an application that has been
e0e57837
MK
1157marked to have file capabilities, but has not been converted to use the
1158.BR libcap (3)
1159API to manipulate its capabilities.
1160(In other words, this is a traditional set-user-ID-root program
1161that has been switched to use file capabilities,
1162but whose code has not been modified to understand capabilities.)
2c767761 1163For such applications,
e0e57837
MK
1164the effective capability bit is set on the file,
1165so that the file permitted capabilities are automatically
1166enabled in the process effective set when executing the file.
1167The kernel recognizes a file which has the effective capability bit set
1168as capability-dumb for the purpose of the check described here.
ade303d7 1169.PP
e0e57837
MK
1170When executing a capability-dumb binary,
1171the kernel checks if the process obtained all permitted capabilities
1172that were specified in the file permitted set,
1173after the capability transformations described above have been performed.
1174(The typical reason why this might
1175.I not
1176occur is that the capability bounding set masked out some
1177of the capabilities in the file permitted set.)
1178If the process did not obtain the full set of
1179file permitted capabilities, then
1180.BR execve (2)
1181fails with the error
1182.BR EPERM .
1183This prevents possible security risks that could arise when
1184a capability-dumb application is executed with less privilege that it needs.
1185Note that, by definition,
1186the application could not itself recognize this problem,
1187since it does not employ the
1188.BR libcap (3)
1189API.
1190.\"
c8e68512 1191.SS Capabilities and execution of programs by root
db18d67f
MK
1192.\" See cap_bprm_set_creds() and handle_privileged_root() in
1193.\" security/commoncap.c (Linux 5.0 source)
bc1950ac
MK
1194In order to mirror traditional UNIX semantics,
1195execution of programs by root (UID 0)
1196as well as execution of set-user-ID-root programs
1197result in special treatment of capabilities during an
1198.BR execve (2).
1199.PP
1200When a process with nonzero UIDs executes a binary:
c8e68512 1201.IP 1. 3
bc1950ac 1202If the real or effective user ID of the process is 0 (root),
c8e68512
MK
1203then the file inheritable and permitted sets are defined to be all ones
1204(i.e., all capabilities enabled).
1205.IP 2.
bc1950ac
MK
1206If the effective user ID of the process is 0 (root) or
1207the file effective bit is in fact enabled,
c8e68512 1208then the file effective bit is defined to be one (enabled).
3dfe7e0d 1209.PP
bc1950ac
MK
1210If a process with nonzero user IDs executes a set-user-ID-root binary
1211that does not have attached capabilities,
1212the file capability sets are considered to be all ones.
1213(See below for a discussion of what happens
1214when a process with nonzero UIDs executes a binary
1215that is both set-user-ID root and has attached file capabilities.)
1216.PP
c8e68512
MK
1217The upshot of the above rules,
1218combined with the capabilities transformations described above,
ab8aa2e4
MK
1219is as follows:
1220.IP * 3
bc1950ac 1221When a process with nonzero UIDs
c930827f 1222.BR execve (2)s
3dfe7e0d 1223a set-user-ID-root program, or when a process with an effective UID of 0
c930827f 1224.BR execve (2)s
3dfe7e0d 1225a program,
c13182ef 1226it gains all capabilities in its permitted and effective capability sets,
c8e68512 1227except those masked out by the capability bounding set.
ab8aa2e4
MK
1228.IP *
1229When a process with a real UID of 0
1230.BR execve (2)s
1231a program,
1232it gains all capabilities in its permitted capability set,
1233.\" but no effective capabilities
1234except those masked out by the capability bounding set.
bc1950ac
MK
1235If, in addition, the file permitted capability bit is on,
1236the process's new permitted capabilities are also assigned
1237to its effective set.
ab8aa2e4 1238.PP
bc1950ac
MK
1239The above special treatments of user ID 0 can be disabled using the
1240securebits mechanism described below.
0603dda3
MK
1241.\"
1242.SS Set-user-ID-root programs that have file capabilities
1243Executing a program that is both set-user-ID root and has
bc1950ac
MK
1244file capabilities iby a process that has nonzero UIDs
1245will cause the process to gain just the
0603dda3
MK
1246capabilities granted by the program
1247(i.e., not all capabilities,
1248as would occur when executing a set-user-ID-root program
1249that does not have any associated file capabilities).
bc1950ac 1250.PP
c199053b
MK
1251Note that one can assign empty capability sets to a program file,
1252and thus it is possible to create a set-user-ID-root program that
1253changes the effective and saved set-user-ID of the process
1254that executes the program to 0,
1255but confers no capabilities to that process.
0603dda3 1256.\"
c8e68512
MK
1257.SS Capability bounding set
1258The capability bounding set is a security mechanism that can be used
1259to limit the capabilities that can be gained during an
1260.BR execve (2).
1261The bounding set is used in the following ways:
1262.IP * 2
1263During an
1264.BR execve (2),
1265the capability bounding set is ANDed with the file permitted
1266capability set, and the result of this operation is assigned to the
1267thread's permitted capability set.
1268The capability bounding set thus places a limit on the permitted
1269capabilities that may be granted by an executable file.
1270.IP *
1271(Since Linux 2.6.25)
1272The capability bounding set acts as a limiting superset for
1273the capabilities that a thread can add to its inheritable set using
1274.BR capset (2).