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