Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_SECCOMP_H |
| 8 | #define _UAPI_LINUX_SECCOMP_H |
| 9 | #include <linux/compiler.h> |
| 10 | #include <linux/types.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #define SECCOMP_MODE_DISABLED 0 |
| 12 | #define SECCOMP_MODE_STRICT 1 |
| 13 | #define SECCOMP_MODE_FILTER 2 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 14 | #define SECCOMP_SET_MODE_STRICT 0 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 15 | #define SECCOMP_SET_MODE_FILTER 1 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 16 | #define SECCOMP_GET_ACTION_AVAIL 2 |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 17 | #define SECCOMP_GET_NOTIF_SIZES 3 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 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) |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 21 | #define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 22 | #define SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1UL << 4) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 23 | #define SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV (1UL << 5) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 24 | #define SECCOMP_RET_KILL_PROCESS 0x80000000U |
| 25 | #define SECCOMP_RET_KILL_THREAD 0x00000000U |
| 26 | #define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define SECCOMP_RET_TRAP 0x00030000U |
| 28 | #define SECCOMP_RET_ERRNO 0x00050000U |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 29 | #define SECCOMP_RET_USER_NOTIF 0x7fc00000U |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | #define SECCOMP_RET_TRACE 0x7ff00000U |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 31 | #define SECCOMP_RET_LOG 0x7ffc0000U |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define SECCOMP_RET_ALLOW 0x7fff0000U |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 33 | #define SECCOMP_RET_ACTION_FULL 0xffff0000U |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | #define SECCOMP_RET_ACTION 0x7fff0000U |
| 35 | #define SECCOMP_RET_DATA 0x0000ffffU |
| 36 | struct seccomp_data { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 37 | int nr; |
| 38 | __u32 arch; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | __u64 instruction_pointer; |
| 40 | __u64 args[6]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | }; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 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 | }; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 53 | #define SECCOMP_USER_NOTIF_FLAG_CONTINUE (1UL << 0) |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 54 | struct seccomp_notif_resp { |
| 55 | __u64 id; |
| 56 | __s64 val; |
| 57 | __s32 error; |
| 58 | __u32 flags; |
| 59 | }; |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 60 | #define SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP (1UL << 0) |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 61 | #define SECCOMP_ADDFD_FLAG_SETFD (1UL << 0) |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 62 | #define SECCOMP_ADDFD_FLAG_SEND (1UL << 1) |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 63 | struct seccomp_notif_addfd { |
| 64 | __u64 id; |
| 65 | __u32 flags; |
| 66 | __u32 srcfd; |
| 67 | __u32 newfd; |
| 68 | __u32 newfd_flags; |
| 69 | }; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 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) |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 77 | #define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOW(2, __u64) |
| 78 | #define SECCOMP_IOCTL_NOTIF_ADDFD SECCOMP_IOW(3, struct seccomp_notif_addfd) |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 79 | #define SECCOMP_IOCTL_NOTIF_SET_FLAGS SECCOMP_IOW(4, __u64) |
Nick Kralevich | a67e4de | 2013-01-14 11:28:26 -0800 | [diff] [blame] | 80 | #endif |