xref: /aosp_15_r20/external/libcap/progs/capshdoc.c (revision 2810ac1b38eead2603277920c78344c84ddf3aff)
1*2810ac1bSKiyoung Kim #include <stdio.h>
2*2810ac1bSKiyoung Kim 
3*2810ac1bSKiyoung Kim #include "./capshdoc.h"
4*2810ac1bSKiyoung Kim 
5*2810ac1bSKiyoung Kim /*
6*2810ac1bSKiyoung Kim  * A line by line explanation of each named capability value
7*2810ac1bSKiyoung Kim  */
8*2810ac1bSKiyoung Kim static const char *explanation0[] = {  /* cap_chown = 0 */
9*2810ac1bSKiyoung Kim     "Allows a process to arbitrarily change the user and",
10*2810ac1bSKiyoung Kim     "group ownership of a file.",
11*2810ac1bSKiyoung Kim     NULL
12*2810ac1bSKiyoung Kim };
13*2810ac1bSKiyoung Kim static const char *explanation1[] = {  /* cap_dac_override = 1 */
14*2810ac1bSKiyoung Kim     "Allows a process to override of all Discretionary",
15*2810ac1bSKiyoung Kim     "Access Control (DAC) access, including ACL execute",
16*2810ac1bSKiyoung Kim     "access. That is read, write or execute files that the",
17*2810ac1bSKiyoung Kim     "process would otherwise not have access to. This",
18*2810ac1bSKiyoung Kim     "excludes DAC access covered by CAP_LINUX_IMMUTABLE.",
19*2810ac1bSKiyoung Kim     NULL
20*2810ac1bSKiyoung Kim };
21*2810ac1bSKiyoung Kim static const char *explanation2[] = {  /* cap_dac_read_search = 2 */
22*2810ac1bSKiyoung Kim     "Allows a process to override all DAC restrictions",
23*2810ac1bSKiyoung Kim     "limiting the read and search of files and",
24*2810ac1bSKiyoung Kim     "directories. This excludes DAC access covered by",
25*2810ac1bSKiyoung Kim     "CAP_LINUX_IMMUTABLE.",
26*2810ac1bSKiyoung Kim     NULL
27*2810ac1bSKiyoung Kim };
28*2810ac1bSKiyoung Kim static const char *explanation3[] = {  /* cap_fowner = 3 */
29*2810ac1bSKiyoung Kim     "Allows a process to perform operations on files, even",
30*2810ac1bSKiyoung Kim     "where file owner ID should otherwise need be equal to",
31*2810ac1bSKiyoung Kim     "the UID, except where CAP_FSETID is applicable. It",
32*2810ac1bSKiyoung Kim     "doesn't override MAC and DAC restrictions.",
33*2810ac1bSKiyoung Kim     "",
34*2810ac1bSKiyoung Kim     "This capability permits the deletion of a file owned",
35*2810ac1bSKiyoung Kim     "by another UID in a directory protected by the sticky",
36*2810ac1bSKiyoung Kim     "(t) bit.",
37*2810ac1bSKiyoung Kim     NULL
38*2810ac1bSKiyoung Kim };
39*2810ac1bSKiyoung Kim static const char *explanation4[] = {  /* cap_fsetid = 4 */
40*2810ac1bSKiyoung Kim     "Allows a process to set the S_ISUID and S_ISUID bits of",
41*2810ac1bSKiyoung Kim     "the file permissions, even when the process' effective",
42*2810ac1bSKiyoung Kim     "UID or GID/supplementary GIDs do not match that of the",
43*2810ac1bSKiyoung Kim     "file.",
44*2810ac1bSKiyoung Kim     NULL
45*2810ac1bSKiyoung Kim };
46*2810ac1bSKiyoung Kim static const char *explanation5[] = {  /* cap_kill = 5 */
47*2810ac1bSKiyoung Kim     "Allows a process to send a kill(2) signal to any other",
48*2810ac1bSKiyoung Kim     "process - overriding the limitation that there be a",
49*2810ac1bSKiyoung Kim     "[E]UID match between source and target process.",
50*2810ac1bSKiyoung Kim     NULL
51*2810ac1bSKiyoung Kim };
52*2810ac1bSKiyoung Kim static const char *explanation6[] = {  /* cap_setgid = 6 */
53*2810ac1bSKiyoung Kim     "Allows a process to freely manipulate its own GIDs:",
54*2810ac1bSKiyoung Kim     "  - arbitrarily set the GID, EGID, REGID, RESGID values",
55*2810ac1bSKiyoung Kim     "  - arbitrarily set the supplementary GIDs",
56*2810ac1bSKiyoung Kim     "  - allows the forging of GID credentials passed over a",
57*2810ac1bSKiyoung Kim     "    socket",
58*2810ac1bSKiyoung Kim     NULL
59*2810ac1bSKiyoung Kim };
60*2810ac1bSKiyoung Kim static const char *explanation7[] = {  /* cap_setuid = 7 */
61*2810ac1bSKiyoung Kim     "Allows a process to freely manipulate its own UIDs:",
62*2810ac1bSKiyoung Kim     "  - arbitrarily set the UID, EUID, REUID and RESUID",
63*2810ac1bSKiyoung Kim     "    values",
64*2810ac1bSKiyoung Kim     "  - allows the forging of UID credentials passed over a",
65*2810ac1bSKiyoung Kim     "    socket",
66*2810ac1bSKiyoung Kim     NULL
67*2810ac1bSKiyoung Kim };
68*2810ac1bSKiyoung Kim static const char *explanation8[] = {  /* cap_setpcap = 8 */
69*2810ac1bSKiyoung Kim     "Allows a process to freely manipulate its inheritable",
70*2810ac1bSKiyoung Kim     "capabilities.",
71*2810ac1bSKiyoung Kim     "",
72*2810ac1bSKiyoung Kim     "Linux supports the POSIX.1e Inheritable set, the POXIX.1e (X",
73*2810ac1bSKiyoung Kim     "vector) known in Linux as the Bounding vector, as well as",
74*2810ac1bSKiyoung Kim     "the Linux extension Ambient vector.",
75*2810ac1bSKiyoung Kim     "",
76*2810ac1bSKiyoung Kim     "This capability permits dropping bits from the Bounding",
77*2810ac1bSKiyoung Kim     "vector (ie. raising B bits in the libcap IAB",
78*2810ac1bSKiyoung Kim     "representation). It also permits the process to raise",
79*2810ac1bSKiyoung Kim     "Ambient vector bits that are both raised in the Permitted",
80*2810ac1bSKiyoung Kim     "and Inheritable sets of the process. This capability cannot",
81*2810ac1bSKiyoung Kim     "be used to raise Permitted bits, Effective bits beyond those",
82*2810ac1bSKiyoung Kim     "already present in the process' permitted set, or",
83*2810ac1bSKiyoung Kim     "Inheritable bits beyond those present in the Bounding",
84*2810ac1bSKiyoung Kim     "vector.",
85*2810ac1bSKiyoung Kim     "",
86*2810ac1bSKiyoung Kim     "[Historical note: prior to the advent of file capabilities",
87*2810ac1bSKiyoung Kim     "(2008), this capability was suppressed by default, as its",
88*2810ac1bSKiyoung Kim     "unsuppressed behavior was not auditable: it could",
89*2810ac1bSKiyoung Kim     "asynchronously grant its own Permitted capabilities to and",
90*2810ac1bSKiyoung Kim     "remove capabilities from other processes arbitrarily. The",
91*2810ac1bSKiyoung Kim     "former leads to undefined behavior, and the latter is better",
92*2810ac1bSKiyoung Kim     "served by the kill system call.]",
93*2810ac1bSKiyoung Kim     NULL
94*2810ac1bSKiyoung Kim };
95*2810ac1bSKiyoung Kim static const char *explanation9[] = {  /* cap_linux_immutable = 9 */
96*2810ac1bSKiyoung Kim     "Allows a process to modify the S_IMMUTABLE and",
97*2810ac1bSKiyoung Kim     "S_APPEND file attributes.",
98*2810ac1bSKiyoung Kim     NULL
99*2810ac1bSKiyoung Kim };
100*2810ac1bSKiyoung Kim static const char *explanation10[] = {  /* cap_net_bind_service = 10 */
101*2810ac1bSKiyoung Kim     "Allows a process to bind to privileged ports:",
102*2810ac1bSKiyoung Kim     "  - TCP/UDP sockets below 1024",
103*2810ac1bSKiyoung Kim     "  - ATM VCIs below 32",
104*2810ac1bSKiyoung Kim     NULL
105*2810ac1bSKiyoung Kim };
106*2810ac1bSKiyoung Kim static const char *explanation11[] = {  /* cap_net_broadcast = 11 */
107*2810ac1bSKiyoung Kim     "Allows a process to broadcast to the network and to",
108*2810ac1bSKiyoung Kim     "listen to multicast.",
109*2810ac1bSKiyoung Kim     NULL
110*2810ac1bSKiyoung Kim };
111*2810ac1bSKiyoung Kim static const char *explanation12[] = {  /* cap_net_admin = 12 */
112*2810ac1bSKiyoung Kim     "Allows a process to perform network configuration",
113*2810ac1bSKiyoung Kim     "operations:",
114*2810ac1bSKiyoung Kim     "  - interface configuration",
115*2810ac1bSKiyoung Kim     "  - administration of IP firewall, masquerading and",
116*2810ac1bSKiyoung Kim     "    accounting",
117*2810ac1bSKiyoung Kim     "  - setting debug options on sockets",
118*2810ac1bSKiyoung Kim     "  - modification of routing tables",
119*2810ac1bSKiyoung Kim     "  - setting arbitrary process, and process group",
120*2810ac1bSKiyoung Kim     "    ownership on sockets",
121*2810ac1bSKiyoung Kim     "  - binding to any address for transparent proxying",
122*2810ac1bSKiyoung Kim     "    (this is also allowed via CAP_NET_RAW)",
123*2810ac1bSKiyoung Kim     "  - setting TOS (Type of service)",
124*2810ac1bSKiyoung Kim     "  - setting promiscuous mode",
125*2810ac1bSKiyoung Kim     "  - clearing driver statistics",
126*2810ac1bSKiyoung Kim     "  - multicasing",
127*2810ac1bSKiyoung Kim     "  - read/write of device-specific registers",
128*2810ac1bSKiyoung Kim     "  - activation of ATM control sockets",
129*2810ac1bSKiyoung Kim     NULL
130*2810ac1bSKiyoung Kim };
131*2810ac1bSKiyoung Kim static const char *explanation13[] = {  /* cap_net_raw = 13 */
132*2810ac1bSKiyoung Kim     "Allows a process to use raw networking:",
133*2810ac1bSKiyoung Kim     "  - RAW sockets",
134*2810ac1bSKiyoung Kim     "  - PACKET sockets",
135*2810ac1bSKiyoung Kim     "  - binding to any address for transparent proxying",
136*2810ac1bSKiyoung Kim     "    (also permitted via CAP_NET_ADMIN)",
137*2810ac1bSKiyoung Kim     NULL
138*2810ac1bSKiyoung Kim };
139*2810ac1bSKiyoung Kim static const char *explanation14[] = {  /* cap_ipc_lock = 14 */
140*2810ac1bSKiyoung Kim     "Allows a process to lock shared memory segments for IPC",
141*2810ac1bSKiyoung Kim     "purposes.  Also enables mlock and mlockall system",
142*2810ac1bSKiyoung Kim     "calls.",
143*2810ac1bSKiyoung Kim     NULL
144*2810ac1bSKiyoung Kim };
145*2810ac1bSKiyoung Kim static const char *explanation15[] = {  /* cap_ipc_owner = 15 */
146*2810ac1bSKiyoung Kim     "Allows a process to override IPC ownership checks.",
147*2810ac1bSKiyoung Kim     NULL
148*2810ac1bSKiyoung Kim };
149*2810ac1bSKiyoung Kim static const char *explanation16[] = {  /* cap_sys_module = 16 */
150*2810ac1bSKiyoung Kim     "Allows a process to initiate the loading and unloading",
151*2810ac1bSKiyoung Kim     "of kernel modules. This capability can effectively",
152*2810ac1bSKiyoung Kim     "modify kernel without limit.",
153*2810ac1bSKiyoung Kim     NULL
154*2810ac1bSKiyoung Kim };
155*2810ac1bSKiyoung Kim static const char *explanation17[] = {  /* cap_sys_rawio = 17 */
156*2810ac1bSKiyoung Kim     "Allows a process to perform raw IO:",
157*2810ac1bSKiyoung Kim     "  - permit ioper/iopl access",
158*2810ac1bSKiyoung Kim     "  - permit sending USB messages to any device via",
159*2810ac1bSKiyoung Kim     "    /dev/bus/usb",
160*2810ac1bSKiyoung Kim     NULL
161*2810ac1bSKiyoung Kim };
162*2810ac1bSKiyoung Kim static const char *explanation18[] = {  /* cap_sys_chroot = 18 */
163*2810ac1bSKiyoung Kim     "Allows a process to perform a chroot syscall to change",
164*2810ac1bSKiyoung Kim     "the effective root of the process' file system:",
165*2810ac1bSKiyoung Kim     "redirect to directory \"/\" to some other location.",
166*2810ac1bSKiyoung Kim     NULL
167*2810ac1bSKiyoung Kim };
168*2810ac1bSKiyoung Kim static const char *explanation19[] = {  /* cap_sys_ptrace = 19 */
169*2810ac1bSKiyoung Kim     "Allows a process to perform a ptrace() of any other",
170*2810ac1bSKiyoung Kim     "process.",
171*2810ac1bSKiyoung Kim     NULL
172*2810ac1bSKiyoung Kim };
173*2810ac1bSKiyoung Kim static const char *explanation20[] = {  /* cap_sys_pacct = 20 */
174*2810ac1bSKiyoung Kim     "Allows a process to configure process accounting.",
175*2810ac1bSKiyoung Kim     NULL
176*2810ac1bSKiyoung Kim };
177*2810ac1bSKiyoung Kim static const char *explanation21[] = {  /* cap_sys_admin = 21 */
178*2810ac1bSKiyoung Kim     "Allows a process to perform a somewhat arbitrary",
179*2810ac1bSKiyoung Kim     "grab-bag of privileged operations. Over time, this",
180*2810ac1bSKiyoung Kim     "capability should weaken as specific capabilities are",
181*2810ac1bSKiyoung Kim     "created for subsets of CAP_SYS_ADMINs functionality:",
182*2810ac1bSKiyoung Kim     "  - configuration of the secure attention key",
183*2810ac1bSKiyoung Kim     "  - administration of the random device",
184*2810ac1bSKiyoung Kim     "  - examination and configuration of disk quotas",
185*2810ac1bSKiyoung Kim     "  - setting the domainname",
186*2810ac1bSKiyoung Kim     "  - setting the hostname",
187*2810ac1bSKiyoung Kim     "  - calling bdflush()",
188*2810ac1bSKiyoung Kim     "  - mount() and umount(), setting up new SMB connection",
189*2810ac1bSKiyoung Kim     "  - some autofs root ioctls",
190*2810ac1bSKiyoung Kim     "  - nfsservctl",
191*2810ac1bSKiyoung Kim     "  - VM86_REQUEST_IRQ",
192*2810ac1bSKiyoung Kim     "  - to read/write pci config on alpha",
193*2810ac1bSKiyoung Kim     "  - irix_prctl on mips (setstacksize)",
194*2810ac1bSKiyoung Kim     "  - flushing all cache on m68k (sys_cacheflush)",
195*2810ac1bSKiyoung Kim     "  - removing semaphores",
196*2810ac1bSKiyoung Kim     "  - Used instead of CAP_CHOWN to \"chown\" IPC message",
197*2810ac1bSKiyoung Kim     "    queues, semaphores and shared memory",
198*2810ac1bSKiyoung Kim     "  - locking/unlocking of shared memory segment",
199*2810ac1bSKiyoung Kim     "  - turning swap on/off",
200*2810ac1bSKiyoung Kim     "  - forged pids on socket credentials passing",
201*2810ac1bSKiyoung Kim     "  - setting readahead and flushing buffers on block",
202*2810ac1bSKiyoung Kim     "    devices",
203*2810ac1bSKiyoung Kim     "  - setting geometry in floppy driver",
204*2810ac1bSKiyoung Kim     "  - turning DMA on/off in xd driver",
205*2810ac1bSKiyoung Kim     "  - administration of md devices (mostly the above, but",
206*2810ac1bSKiyoung Kim     "    some extra ioctls)",
207*2810ac1bSKiyoung Kim     "  - tuning the ide driver",
208*2810ac1bSKiyoung Kim     "  - access to the nvram device",
209*2810ac1bSKiyoung Kim     "  - administration of apm_bios, serial and bttv (TV)",
210*2810ac1bSKiyoung Kim     "    device",
211*2810ac1bSKiyoung Kim     "  - manufacturer commands in isdn CAPI support driver",
212*2810ac1bSKiyoung Kim     "  - reading non-standardized portions of PCI",
213*2810ac1bSKiyoung Kim     "    configuration space",
214*2810ac1bSKiyoung Kim     "  - DDI debug ioctl on sbpcd driver",
215*2810ac1bSKiyoung Kim     "  - setting up serial ports",
216*2810ac1bSKiyoung Kim     "  - sending raw qic-117 commands",
217*2810ac1bSKiyoung Kim     "  - enabling/disabling tagged queuing on SCSI",
218*2810ac1bSKiyoung Kim     "    controllers and sending arbitrary SCSI commands",
219*2810ac1bSKiyoung Kim     "  - setting encryption key on loopback filesystem",
220*2810ac1bSKiyoung Kim     "  - setting zone reclaim policy",
221*2810ac1bSKiyoung Kim     NULL
222*2810ac1bSKiyoung Kim };
223*2810ac1bSKiyoung Kim static const char *explanation22[] = {  /* cap_sys_boot = 22 */
224*2810ac1bSKiyoung Kim     "Allows a process to initiate a reboot of the system.",
225*2810ac1bSKiyoung Kim     NULL
226*2810ac1bSKiyoung Kim };
227*2810ac1bSKiyoung Kim static const char *explanation23[] = {  /* cap_sys_nice = 23 */
228*2810ac1bSKiyoung Kim     "Allows a process to maipulate the execution priorities",
229*2810ac1bSKiyoung Kim     "of arbitrary processes:",
230*2810ac1bSKiyoung Kim     "  - those involving different UIDs",
231*2810ac1bSKiyoung Kim     "  - setting their CPU affinity",
232*2810ac1bSKiyoung Kim     "  - alter the FIFO vs. round-robin (realtime)",
233*2810ac1bSKiyoung Kim     "    scheduling for itself and other processes.",
234*2810ac1bSKiyoung Kim     NULL
235*2810ac1bSKiyoung Kim };
236*2810ac1bSKiyoung Kim static const char *explanation24[] = {  /* cap_sys_resource = 24 */
237*2810ac1bSKiyoung Kim     "Allows a process to adjust resource related parameters",
238*2810ac1bSKiyoung Kim     "of processes and the system:",
239*2810ac1bSKiyoung Kim     "  - set and override resource limits",
240*2810ac1bSKiyoung Kim     "  - override quota limits",
241*2810ac1bSKiyoung Kim     "  - override the reserved space on ext2 filesystem",
242*2810ac1bSKiyoung Kim     "    (this can also be achieved via CAP_FSETID)",
243*2810ac1bSKiyoung Kim     "  - modify the data journaling mode on ext3 filesystem,",
244*2810ac1bSKiyoung Kim     "    which uses journaling resources",
245*2810ac1bSKiyoung Kim     "  - override size restrictions on IPC message queues",
246*2810ac1bSKiyoung Kim     "  - configure more than 64Hz interrupts from the",
247*2810ac1bSKiyoung Kim     "    real-time clock",
248*2810ac1bSKiyoung Kim     "  - override the maximum number of consoles for console",
249*2810ac1bSKiyoung Kim     "    allocation",
250*2810ac1bSKiyoung Kim     "  - override the maximum number of keymaps",
251*2810ac1bSKiyoung Kim     NULL
252*2810ac1bSKiyoung Kim };
253*2810ac1bSKiyoung Kim static const char *explanation25[] = {  /* cap_sys_time = 25 */
254*2810ac1bSKiyoung Kim     "Allows a process to perform time manipulation of clocks:",
255*2810ac1bSKiyoung Kim     "  - alter the system clock",
256*2810ac1bSKiyoung Kim     "  - enable irix_stime on MIPS",
257*2810ac1bSKiyoung Kim     "  - set the real-time clock",
258*2810ac1bSKiyoung Kim     NULL
259*2810ac1bSKiyoung Kim };
260*2810ac1bSKiyoung Kim static const char *explanation26[] = {  /* cap_sys_tty_config = 26 */
261*2810ac1bSKiyoung Kim     "Allows a process to manipulate tty devices:",
262*2810ac1bSKiyoung Kim     "  - configure tty devices",
263*2810ac1bSKiyoung Kim     "  - perform vhangup() of a tty",
264*2810ac1bSKiyoung Kim     NULL
265*2810ac1bSKiyoung Kim };
266*2810ac1bSKiyoung Kim static const char *explanation27[] = {  /* cap_mknod = 27 */
267*2810ac1bSKiyoung Kim     "Allows a process to perform privileged operations with",
268*2810ac1bSKiyoung Kim     "the mknod() system call.",
269*2810ac1bSKiyoung Kim     NULL
270*2810ac1bSKiyoung Kim };
271*2810ac1bSKiyoung Kim static const char *explanation28[] = {  /* cap_lease = 28 */
272*2810ac1bSKiyoung Kim     "Allows a process to take leases on files.",
273*2810ac1bSKiyoung Kim     NULL
274*2810ac1bSKiyoung Kim };
275*2810ac1bSKiyoung Kim static const char *explanation29[] = {  /* cap_audit_write = 29 */
276*2810ac1bSKiyoung Kim     "Allows a process to write to the audit log via a",
277*2810ac1bSKiyoung Kim     "unicast netlink socket.",
278*2810ac1bSKiyoung Kim     NULL
279*2810ac1bSKiyoung Kim };
280*2810ac1bSKiyoung Kim static const char *explanation30[] = {  /* cap_audit_control = 30 */
281*2810ac1bSKiyoung Kim     "Allows a process to configure audit logging via a",
282*2810ac1bSKiyoung Kim     "unicast netlink socket.",
283*2810ac1bSKiyoung Kim     NULL
284*2810ac1bSKiyoung Kim };
285*2810ac1bSKiyoung Kim static const char *explanation31[] = {  /* cap_setfcap = 31 */
286*2810ac1bSKiyoung Kim     "Allows a process to set capabilities on files.",
287*2810ac1bSKiyoung Kim     "Permits a process to uid_map the uid=0 of the",
288*2810ac1bSKiyoung Kim     "parent user namespace into that of the child",
289*2810ac1bSKiyoung Kim     "namespace. Also, permits a process to override",
290*2810ac1bSKiyoung Kim     "securebits locks through user namespace",
291*2810ac1bSKiyoung Kim     "creation.",
292*2810ac1bSKiyoung Kim     NULL
293*2810ac1bSKiyoung Kim };
294*2810ac1bSKiyoung Kim static const char *explanation32[] = {  /* cap_mac_override = 32 */
295*2810ac1bSKiyoung Kim     "Allows a process to override Manditory Access Control",
296*2810ac1bSKiyoung Kim     "(MAC) access. Not all kernels are configured with a MAC",
297*2810ac1bSKiyoung Kim     "mechanism, but this is the capability reserved for",
298*2810ac1bSKiyoung Kim     "overriding them.",
299*2810ac1bSKiyoung Kim     NULL
300*2810ac1bSKiyoung Kim };
301*2810ac1bSKiyoung Kim static const char *explanation33[] = {  /* cap_mac_admin = 33 */
302*2810ac1bSKiyoung Kim     "Allows a process to configure the Mandatory Access",
303*2810ac1bSKiyoung Kim     "Control (MAC) policy. Not all kernels are configured",
304*2810ac1bSKiyoung Kim     "with a MAC enabled, but if they are this capability is",
305*2810ac1bSKiyoung Kim     "reserved for code to perform administration tasks.",
306*2810ac1bSKiyoung Kim     NULL
307*2810ac1bSKiyoung Kim };
308*2810ac1bSKiyoung Kim static const char *explanation34[] = {  /* cap_syslog = 34 */
309*2810ac1bSKiyoung Kim     "Allows a process to configure the kernel's syslog",
310*2810ac1bSKiyoung Kim     "(printk) behavior.",
311*2810ac1bSKiyoung Kim     NULL
312*2810ac1bSKiyoung Kim };
313*2810ac1bSKiyoung Kim static const char *explanation35[] = {  /* cap_wake_alarm = 35 */
314*2810ac1bSKiyoung Kim     "Allows a process to trigger something that can wake the",
315*2810ac1bSKiyoung Kim     "system up.",
316*2810ac1bSKiyoung Kim     NULL
317*2810ac1bSKiyoung Kim };
318*2810ac1bSKiyoung Kim static const char *explanation36[] = {  /* cap_block_suspend = 36 */
319*2810ac1bSKiyoung Kim     "Allows a process to block system suspends - prevent the",
320*2810ac1bSKiyoung Kim     "system from entering a lower power state.",
321*2810ac1bSKiyoung Kim     NULL
322*2810ac1bSKiyoung Kim };
323*2810ac1bSKiyoung Kim static const char *explanation37[] = {  /* cap_audit_read = 37 */
324*2810ac1bSKiyoung Kim     "Allows a process to read the audit log via a multicast",
325*2810ac1bSKiyoung Kim     "netlink socket.",
326*2810ac1bSKiyoung Kim     NULL
327*2810ac1bSKiyoung Kim };
328*2810ac1bSKiyoung Kim static const char *explanation38[] = {  /* cap_perfmon = 38 */
329*2810ac1bSKiyoung Kim     "Allows a process to enable observability of privileged",
330*2810ac1bSKiyoung Kim     "operations related to performance. The mechanisms",
331*2810ac1bSKiyoung Kim     "include perf_events, i915_perf and other kernel",
332*2810ac1bSKiyoung Kim     "subsystems.",
333*2810ac1bSKiyoung Kim     NULL
334*2810ac1bSKiyoung Kim };
335*2810ac1bSKiyoung Kim static const char *explanation39[] = {  /* cap_bpf = 39 */
336*2810ac1bSKiyoung Kim     "Allows a process to manipulate aspects of the kernel",
337*2810ac1bSKiyoung Kim     "enhanced Berkeley Packet Filter (BPF) system. This is",
338*2810ac1bSKiyoung Kim     "an execution subsystem of the kernel, that manages BPF",
339*2810ac1bSKiyoung Kim     "programs. CAP_BPF permits a process to:",
340*2810ac1bSKiyoung Kim     "  - create all types of BPF maps",
341*2810ac1bSKiyoung Kim     "  - advanced verifier features:",
342*2810ac1bSKiyoung Kim     "    - indirect variable access",
343*2810ac1bSKiyoung Kim     "    - bounded loops",
344*2810ac1bSKiyoung Kim     "    - BPF to BPF function calls",
345*2810ac1bSKiyoung Kim     "    - scalar precision tracking",
346*2810ac1bSKiyoung Kim     "    - larger complexity limits",
347*2810ac1bSKiyoung Kim     "    - dead code elimination",
348*2810ac1bSKiyoung Kim     "    - potentially other features",
349*2810ac1bSKiyoung Kim     "",
350*2810ac1bSKiyoung Kim     "Other capabilities can be used together with CAP_BFP to",
351*2810ac1bSKiyoung Kim     "further manipulate the BPF system:",
352*2810ac1bSKiyoung Kim     "  - CAP_PERFMON relaxes the verifier checks as follows:",
353*2810ac1bSKiyoung Kim     "    - BPF programs can use pointer-to-integer",
354*2810ac1bSKiyoung Kim     "      conversions",
355*2810ac1bSKiyoung Kim     "    - speculation attack hardening measures can be",
356*2810ac1bSKiyoung Kim     "      bypassed",
357*2810ac1bSKiyoung Kim     "    - bpf_probe_read to read arbitrary kernel memory is",
358*2810ac1bSKiyoung Kim     "      permitted",
359*2810ac1bSKiyoung Kim     "    - bpf_trace_printk to print the content of kernel",
360*2810ac1bSKiyoung Kim     "      memory",
361*2810ac1bSKiyoung Kim     "  - CAP_SYS_ADMIN permits the following:",
362*2810ac1bSKiyoung Kim     "    - use of bpf_probe_write_user",
363*2810ac1bSKiyoung Kim     "    - iteration over the system-wide loaded programs,",
364*2810ac1bSKiyoung Kim     "      maps, links BTFs and convert their IDs to file",
365*2810ac1bSKiyoung Kim     "      descriptors.",
366*2810ac1bSKiyoung Kim     "  - CAP_PERFMON is required to load tracing programs.",
367*2810ac1bSKiyoung Kim     "  - CAP_NET_ADMIN is required to load networking",
368*2810ac1bSKiyoung Kim     "    programs.",
369*2810ac1bSKiyoung Kim     NULL
370*2810ac1bSKiyoung Kim };
371*2810ac1bSKiyoung Kim static const char *explanation40[] = {  /* cap_checkpoint_restore = 40 */
372*2810ac1bSKiyoung Kim     "Allows a process to perform checkpoint",
373*2810ac1bSKiyoung Kim     "and restore operations. Also permits",
374*2810ac1bSKiyoung Kim     "explicit PID control via clone3() and",
375*2810ac1bSKiyoung Kim     "also writing to ns_last_pid.",
376*2810ac1bSKiyoung Kim     NULL
377*2810ac1bSKiyoung Kim };
378*2810ac1bSKiyoung Kim const char **explanations[] = {
379*2810ac1bSKiyoung Kim     explanation0,
380*2810ac1bSKiyoung Kim     explanation1,
381*2810ac1bSKiyoung Kim     explanation2,
382*2810ac1bSKiyoung Kim     explanation3,
383*2810ac1bSKiyoung Kim     explanation4,
384*2810ac1bSKiyoung Kim     explanation5,
385*2810ac1bSKiyoung Kim     explanation6,
386*2810ac1bSKiyoung Kim     explanation7,
387*2810ac1bSKiyoung Kim     explanation8,
388*2810ac1bSKiyoung Kim     explanation9,
389*2810ac1bSKiyoung Kim     explanation10,
390*2810ac1bSKiyoung Kim     explanation11,
391*2810ac1bSKiyoung Kim     explanation12,
392*2810ac1bSKiyoung Kim     explanation13,
393*2810ac1bSKiyoung Kim     explanation14,
394*2810ac1bSKiyoung Kim     explanation15,
395*2810ac1bSKiyoung Kim     explanation16,
396*2810ac1bSKiyoung Kim     explanation17,
397*2810ac1bSKiyoung Kim     explanation18,
398*2810ac1bSKiyoung Kim     explanation19,
399*2810ac1bSKiyoung Kim     explanation20,
400*2810ac1bSKiyoung Kim     explanation21,
401*2810ac1bSKiyoung Kim     explanation22,
402*2810ac1bSKiyoung Kim     explanation23,
403*2810ac1bSKiyoung Kim     explanation24,
404*2810ac1bSKiyoung Kim     explanation25,
405*2810ac1bSKiyoung Kim     explanation26,
406*2810ac1bSKiyoung Kim     explanation27,
407*2810ac1bSKiyoung Kim     explanation28,
408*2810ac1bSKiyoung Kim     explanation29,
409*2810ac1bSKiyoung Kim     explanation30,
410*2810ac1bSKiyoung Kim     explanation31,
411*2810ac1bSKiyoung Kim     explanation32,
412*2810ac1bSKiyoung Kim     explanation33,
413*2810ac1bSKiyoung Kim     explanation34,
414*2810ac1bSKiyoung Kim     explanation35,
415*2810ac1bSKiyoung Kim     explanation36,
416*2810ac1bSKiyoung Kim     explanation37,
417*2810ac1bSKiyoung Kim     explanation38,
418*2810ac1bSKiyoung Kim     explanation39,
419*2810ac1bSKiyoung Kim     explanation40,
420*2810ac1bSKiyoung Kim };
421*2810ac1bSKiyoung Kim 
422*2810ac1bSKiyoung Kim const int capsh_doc_limit = 41;
423