blob: 78cba92b2ca4cd1669bcef29c7e2f0742b28dae1 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_CAPABILITY_H
20#define _UAPI_LINUX_CAPABILITY_H
21#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#define _LINUX_CAPABILITY_VERSION_1 0x19980330
23#define _LINUX_CAPABILITY_U32S_1 1
24#define _LINUX_CAPABILITY_VERSION_2 0x20071026
25#define _LINUX_CAPABILITY_U32S_2 2
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define _LINUX_CAPABILITY_VERSION_3 0x20080522
27#define _LINUX_CAPABILITY_U32S_3 2
28typedef struct __user_cap_header_struct {
Tao Baod7db5942015-01-28 10:07:51 -080029 __u32 version;
Tao Baod7db5942015-01-28 10:07:51 -080030 int pid;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070031} * cap_user_header_t;
Christopher Ferris8666d042023-09-06 14:55:31 -070032struct __user_cap_data_struct {
Tao Baod7db5942015-01-28 10:07:51 -080033 __u32 effective;
Tao Baod7db5942015-01-28 10:07:51 -080034 __u32 permitted;
35 __u32 inheritable;
Christopher Ferris8666d042023-09-06 14:55:31 -070036};
37typedef struct __user_cap_data_struct * cap_user_data_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070038#define VFS_CAP_REVISION_MASK 0xFF000000
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define VFS_CAP_REVISION_SHIFT 24
40#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
41#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
42#define VFS_CAP_REVISION_1 0x01000000
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define VFS_CAP_U32_1 1
Tao Baod7db5942015-01-28 10:07:51 -080044#define XATTR_CAPS_SZ_1 (sizeof(__le32) * (1 + 2 * VFS_CAP_U32_1))
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define VFS_CAP_REVISION_2 0x02000000
46#define VFS_CAP_U32_2 2
Tao Baod7db5942015-01-28 10:07:51 -080047#define XATTR_CAPS_SZ_2 (sizeof(__le32) * (1 + 2 * VFS_CAP_U32_2))
Christopher Ferris1308ad32017-11-14 17:32:13 -080048#define VFS_CAP_REVISION_3 0x03000000
49#define VFS_CAP_U32_3 2
50#define XATTR_CAPS_SZ_3 (sizeof(__le32) * (2 + 2 * VFS_CAP_U32_3))
51#define XATTR_CAPS_SZ XATTR_CAPS_SZ_3
52#define VFS_CAP_U32 VFS_CAP_U32_3
53#define VFS_CAP_REVISION VFS_CAP_REVISION_3
Ben Cheng655a7c02013-10-16 16:09:24 -070054struct vfs_cap_data {
Tao Baod7db5942015-01-28 10:07:51 -080055 __le32 magic_etc;
56 struct {
57 __le32 permitted;
Tao Baod7db5942015-01-28 10:07:51 -080058 __le32 inheritable;
59 } data[VFS_CAP_U32];
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
Christopher Ferris1308ad32017-11-14 17:32:13 -080061struct vfs_ns_cap_data {
62 __le32 magic_etc;
63 struct {
64 __le32 permitted;
65 __le32 inheritable;
66 } data[VFS_CAP_U32];
67 __le32 rootid;
68};
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
71#define CAP_CHOWN 0
72#define CAP_DAC_OVERRIDE 1
73#define CAP_DAC_READ_SEARCH 2
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define CAP_FOWNER 3
75#define CAP_FSETID 4
76#define CAP_KILL 5
77#define CAP_SETGID 6
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define CAP_SETUID 7
79#define CAP_SETPCAP 8
80#define CAP_LINUX_IMMUTABLE 9
81#define CAP_NET_BIND_SERVICE 10
Ben Cheng655a7c02013-10-16 16:09:24 -070082#define CAP_NET_BROADCAST 11
83#define CAP_NET_ADMIN 12
84#define CAP_NET_RAW 13
85#define CAP_IPC_LOCK 14
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define CAP_IPC_OWNER 15
87#define CAP_SYS_MODULE 16
88#define CAP_SYS_RAWIO 17
89#define CAP_SYS_CHROOT 18
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define CAP_SYS_PTRACE 19
91#define CAP_SYS_PACCT 20
92#define CAP_SYS_ADMIN 21
93#define CAP_SYS_BOOT 22
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define CAP_SYS_NICE 23
95#define CAP_SYS_RESOURCE 24
96#define CAP_SYS_TIME 25
97#define CAP_SYS_TTY_CONFIG 26
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define CAP_MKNOD 27
99#define CAP_LEASE 28
100#define CAP_AUDIT_WRITE 29
101#define CAP_AUDIT_CONTROL 30
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define CAP_SETFCAP 31
103#define CAP_MAC_OVERRIDE 32
104#define CAP_MAC_ADMIN 33
105#define CAP_SYSLOG 34
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define CAP_WAKE_ALARM 35
107#define CAP_BLOCK_SUSPEND 36
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700108#define CAP_AUDIT_READ 37
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700109#define CAP_PERFMON 38
110#define CAP_BPF 39
Christopher Ferris25c18d42020-10-14 17:42:58 -0700111#define CAP_CHECKPOINT_RESTORE 40
112#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700113#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define CAP_TO_INDEX(x) ((x) >> 5)
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000115#define CAP_TO_MASK(x) (1U << ((x) & 31))
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#endif