xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/seccomp.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1*8d67ca89SAndroid Build Coastguard Worker /*
2*8d67ca89SAndroid Build Coastguard Worker  * This file is auto-generated. Modifications will be lost.
3*8d67ca89SAndroid Build Coastguard Worker  *
4*8d67ca89SAndroid Build Coastguard Worker  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5*8d67ca89SAndroid Build Coastguard Worker  * for more information.
6*8d67ca89SAndroid Build Coastguard Worker  */
7*8d67ca89SAndroid Build Coastguard Worker #ifndef _UAPI_LINUX_SECCOMP_H
8*8d67ca89SAndroid Build Coastguard Worker #define _UAPI_LINUX_SECCOMP_H
9*8d67ca89SAndroid Build Coastguard Worker #include <linux/compiler.h>
10*8d67ca89SAndroid Build Coastguard Worker #include <linux/types.h>
11*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_MODE_DISABLED 0
12*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_MODE_STRICT 1
13*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_MODE_FILTER 2
14*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_SET_MODE_STRICT 0
15*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_SET_MODE_FILTER 1
16*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_GET_ACTION_AVAIL 2
17*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_GET_NOTIF_SIZES 3
18*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_TSYNC (1UL << 0)
19*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_LOG (1UL << 1)
20*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)
21*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
22*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1UL << 4)
23*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV (1UL << 5)
24*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_KILL_PROCESS 0x80000000U
25*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_KILL_THREAD 0x00000000U
26*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD
27*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_TRAP 0x00030000U
28*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_ERRNO 0x00050000U
29*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_USER_NOTIF 0x7fc00000U
30*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_TRACE 0x7ff00000U
31*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_LOG 0x7ffc0000U
32*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_ALLOW 0x7fff0000U
33*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_ACTION_FULL 0xffff0000U
34*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_ACTION 0x7fff0000U
35*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_RET_DATA 0x0000ffffU
36*8d67ca89SAndroid Build Coastguard Worker struct seccomp_data {
37*8d67ca89SAndroid Build Coastguard Worker   int nr;
38*8d67ca89SAndroid Build Coastguard Worker   __u32 arch;
39*8d67ca89SAndroid Build Coastguard Worker   __u64 instruction_pointer;
40*8d67ca89SAndroid Build Coastguard Worker   __u64 args[6];
41*8d67ca89SAndroid Build Coastguard Worker };
42*8d67ca89SAndroid Build Coastguard Worker struct seccomp_notif_sizes {
43*8d67ca89SAndroid Build Coastguard Worker   __u16 seccomp_notif;
44*8d67ca89SAndroid Build Coastguard Worker   __u16 seccomp_notif_resp;
45*8d67ca89SAndroid Build Coastguard Worker   __u16 seccomp_data;
46*8d67ca89SAndroid Build Coastguard Worker };
47*8d67ca89SAndroid Build Coastguard Worker struct seccomp_notif {
48*8d67ca89SAndroid Build Coastguard Worker   __u64 id;
49*8d67ca89SAndroid Build Coastguard Worker   __u32 pid;
50*8d67ca89SAndroid Build Coastguard Worker   __u32 flags;
51*8d67ca89SAndroid Build Coastguard Worker   struct seccomp_data data;
52*8d67ca89SAndroid Build Coastguard Worker };
53*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_USER_NOTIF_FLAG_CONTINUE (1UL << 0)
54*8d67ca89SAndroid Build Coastguard Worker struct seccomp_notif_resp {
55*8d67ca89SAndroid Build Coastguard Worker   __u64 id;
56*8d67ca89SAndroid Build Coastguard Worker   __s64 val;
57*8d67ca89SAndroid Build Coastguard Worker   __s32 error;
58*8d67ca89SAndroid Build Coastguard Worker   __u32 flags;
59*8d67ca89SAndroid Build Coastguard Worker };
60*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP (1UL << 0)
61*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_ADDFD_FLAG_SETFD (1UL << 0)
62*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_ADDFD_FLAG_SEND (1UL << 1)
63*8d67ca89SAndroid Build Coastguard Worker struct seccomp_notif_addfd {
64*8d67ca89SAndroid Build Coastguard Worker   __u64 id;
65*8d67ca89SAndroid Build Coastguard Worker   __u32 flags;
66*8d67ca89SAndroid Build Coastguard Worker   __u32 srcfd;
67*8d67ca89SAndroid Build Coastguard Worker   __u32 newfd;
68*8d67ca89SAndroid Build Coastguard Worker   __u32 newfd_flags;
69*8d67ca89SAndroid Build Coastguard Worker };
70*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOC_MAGIC '!'
71*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IO(nr) _IO(SECCOMP_IOC_MAGIC, nr)
72*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOR(nr,type) _IOR(SECCOMP_IOC_MAGIC, nr, type)
73*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOW(nr,type) _IOW(SECCOMP_IOC_MAGIC, nr, type)
74*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOWR(nr,type) _IOWR(SECCOMP_IOC_MAGIC, nr, type)
75*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOCTL_NOTIF_RECV SECCOMP_IOWR(0, struct seccomp_notif)
76*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOCTL_NOTIF_SEND SECCOMP_IOWR(1, struct seccomp_notif_resp)
77*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOW(2, __u64)
78*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOCTL_NOTIF_ADDFD SECCOMP_IOW(3, struct seccomp_notif_addfd)
79*8d67ca89SAndroid Build Coastguard Worker #define SECCOMP_IOCTL_NOTIF_SET_FLAGS SECCOMP_IOW(4, __u64)
80*8d67ca89SAndroid Build Coastguard Worker #endif
81