Line data Source code
1 : /* THIS FILE WAS GENERATED BY generate_filters.py. DO NOT EDIT BY HAND! */
2 : #ifndef HEADER_fd_src_discof_genesis_generated_fd_genesi_tile_seccomp_h
3 : #define HEADER_fd_src_discof_genesis_generated_fd_genesi_tile_seccomp_h
4 :
5 : #if defined(__linux__)
6 :
7 : #include "../../../../src/util/fd_util_base.h"
8 : #include <linux/audit.h>
9 : #include <linux/capability.h>
10 : #include <linux/filter.h>
11 : #include <linux/seccomp.h>
12 : #include <linux/bpf.h>
13 : #include <linux/unistd.h>
14 : #include <sys/syscall.h>
15 : #include <signal.h>
16 : #include <stddef.h>
17 :
18 : #if defined(__i386__)
19 : # define ARCH_NR AUDIT_ARCH_I386
20 : #elif defined(__x86_64__)
21 : # define ARCH_NR AUDIT_ARCH_X86_64
22 : #elif defined(__aarch64__)
23 : # define ARCH_NR AUDIT_ARCH_AARCH64
24 : #elif defined(__riscv) && __riscv_xlen == 64
25 : # define ARCH_NR AUDIT_ARCH_RISCV64
26 : #else
27 : # error "Target architecture is unsupported by seccomp."
28 : #endif
29 :
30 : #define FD_SECCOMP_ARG_LO_OFFSET(argno) ( offsetof( struct seccomp_data, args[(argno)] ) )
31 : #define FD_SECCOMP_ARG_HI_OFFSET(argno) ( offsetof( struct seccomp_data, args[(argno)] ) + 4U )
32 :
33 : #define FD_SECCOMP_ARG_LO(x) ((uint)(((ulong)(uint)(int)(x) ) & 0xffffffffUL))
34 : #define FD_SECCOMP_ARG_HI(x) ((uint)(((ulong)(x) >> 32) & 0xffffffffUL))
35 :
36 : static const uint sock_filter_policy_fd_genesi_tile_instr_cnt = 131;
37 :
38 0 : static void populate_sock_filter_policy_fd_genesi_tile( ulong out_cnt, struct sock_filter out[ static 131 ], uint logfile_fd, uint in_genesis_fd, uint out_genesis_fd, uint out_dir_fd, uint accounts_fd, uint epoll_inner_fd, uint epoll_outer_fd ) {
39 0 : FD_TEST( out_cnt >= 131 );
40 0 : struct sock_filter filter[131] = {
41 : /* validate architecture */
42 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, ( offsetof( struct seccomp_data, arch ) )),
43 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ARCH_NR, 0, /* RET_KILL_PROCESS */ 17 ),
44 : /* load syscall number */
45 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, ( offsetof( struct seccomp_data, nr ) )),
46 : /* check write */
47 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_write, /* check_write */ 17, 0 ),
48 : /* check fsync */
49 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_fsync, /* check_fsync */ 24, 0 ),
50 : /* check fstat */
51 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_fstat, /* check_fstat */ 27, 0 ),
52 : /* check close */
53 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_close, /* check_close */ 30, 0 ),
54 : /* check read */
55 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_read, /* check_read */ 39, 0 ),
56 : /* check exit */
57 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_exit, /* check_exit */ 42, 0 ),
58 : /* check pwritev2 */
59 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_pwritev2, /* check_pwritev2 */ 45, 0 ),
60 : /* check preadv2 */
61 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_preadv2, /* check_preadv2 */ 48, 0 ),
62 : /* check fallocate */
63 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_fallocate, /* check_fallocate */ 51, 0 ),
64 : /* allow ppoll */
65 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_ppoll, /* RET_ALLOW */ 7, 0 ),
66 : /* check sendto */
67 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_sendto, /* check_sendto */ 55, 0 ),
68 : /* check recvfrom */
69 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_recvfrom, /* check_recvfrom */ 74, 0 ),
70 : /* check renameat2 */
71 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_renameat2, /* check_renameat2 */ 95, 0 ),
72 : /* check epoll_ctl */
73 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_epoll_ctl, /* check_epoll_ctl */ 100, 0 ),
74 : /* check futex */
75 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_futex, /* check_futex */ 107, 0 ),
76 : /* allow restart_syscall */
77 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, SYS_restart_syscall, /* RET_ALLOW */ 1, 0 ),
78 : // RET_KILL_PROCESS:
79 : /* default deny */
80 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
81 : // RET_ALLOW:
82 : /* allow */
83 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
84 : // check_write:
85 : /* arg 0 low 32 bits */
86 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
87 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000002U, /* write_ALLOW */ 5, /* or_1 */ 0 ),
88 : // or_1:
89 : /* arg 0 low 32 bits */
90 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
91 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_genesis_fd)), /* write_ALLOW */ 3, /* or_2 */ 0 ),
92 : // or_2:
93 : /* arg 0 low 32 bits */
94 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
95 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(logfile_fd)), /* write_ALLOW */ 1, /* write_KILL */ 0 ),
96 : // write_KILL:
97 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
98 : // write_ALLOW:
99 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
100 : // check_fsync:
101 : /* arg 0 low 32 bits */
102 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
103 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(logfile_fd)), /* fsync_ALLOW */ 1, /* fsync_KILL */ 0 ),
104 : // fsync_KILL:
105 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
106 : // fsync_ALLOW:
107 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
108 : // check_fstat:
109 : /* arg 0 low 32 bits */
110 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
111 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(in_genesis_fd)), /* fstat_ALLOW */ 1, /* fstat_KILL */ 0 ),
112 : // fstat_KILL:
113 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
114 : // fstat_ALLOW:
115 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
116 : // check_close:
117 : /* arg 0 low 32 bits */
118 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
119 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(logfile_fd)), /* close_KILL */ 6, /* or_3 */ 0 ),
120 : // or_3:
121 : /* arg 0 low 32 bits */
122 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
123 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_dir_fd)), /* close_KILL */ 4, /* or_4 */ 0 ),
124 : // or_4:
125 : /* arg 0 low 32 bits */
126 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
127 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_genesis_fd)), /* close_KILL */ 2, /* or_5 */ 0 ),
128 : // or_5:
129 : /* arg 0 low 32 bits */
130 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
131 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000002U, /* close_KILL */ 0, /* close_ALLOW */ 1 ),
132 : // close_KILL:
133 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
134 : // close_ALLOW:
135 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
136 : // check_read:
137 : /* arg 0 low 32 bits */
138 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
139 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(in_genesis_fd)), /* read_ALLOW */ 1, /* read_KILL */ 0 ),
140 : // read_KILL:
141 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
142 : // read_ALLOW:
143 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
144 : // check_exit:
145 : /* arg 0 low 32 bits */
146 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
147 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* exit_ALLOW */ 1, /* exit_KILL */ 0 ),
148 : // exit_KILL:
149 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
150 : // exit_ALLOW:
151 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
152 : // check_pwritev2:
153 : /* arg 0 low 32 bits */
154 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
155 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(accounts_fd)), /* pwritev2_ALLOW */ 1, /* pwritev2_KILL */ 0 ),
156 : // pwritev2_KILL:
157 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
158 : // pwritev2_ALLOW:
159 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
160 : // check_preadv2:
161 : /* arg 0 low 32 bits */
162 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
163 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(accounts_fd)), /* preadv2_ALLOW */ 1, /* preadv2_KILL */ 0 ),
164 : // preadv2_KILL:
165 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
166 : // preadv2_ALLOW:
167 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
168 : // check_fallocate:
169 : /* arg 0 low 32 bits */
170 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
171 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(accounts_fd)), /* and_6 */ 0, /* fallocate_KILL */ 2 ),
172 : // and_6:
173 : /* arg 1 low 32 bits */
174 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(1)),
175 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* fallocate_ALLOW */ 1, /* fallocate_KILL */ 0 ),
176 : // fallocate_KILL:
177 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
178 : // fallocate_ALLOW:
179 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
180 : // check_sendto:
181 : /* arg 0 low 32 bits */
182 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
183 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(logfile_fd)), /* sendto_KILL */ 16, /* or_8 */ 0 ),
184 : // or_8:
185 : /* arg 0 low 32 bits */
186 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
187 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(in_genesis_fd)), /* sendto_KILL */ 14, /* or_9 */ 0 ),
188 : // or_9:
189 : /* arg 0 low 32 bits */
190 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
191 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_dir_fd)), /* sendto_KILL */ 12, /* or_10 */ 0 ),
192 : // or_10:
193 : /* arg 0 low 32 bits */
194 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
195 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_genesis_fd)), /* sendto_KILL */ 10, /* or_11 */ 0 ),
196 : // or_11:
197 : /* arg 0 low 32 bits */
198 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
199 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000002U, /* sendto_KILL */ 8, /* and_7 */ 0 ),
200 : // and_7:
201 : /* arg 3 low 32 bits */
202 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(3)),
203 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, FD_SECCOMP_ARG_LO(MSG_NOSIGNAL), /* and_12 */ 0, /* sendto_KILL */ 6 ),
204 : // and_12:
205 : /* arg 4 high 32 bits */
206 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_HI_OFFSET(4)),
207 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* arg_hi_eq_14 */ 0, /* sendto_KILL */ 4 ),
208 : // arg_hi_eq_14:
209 : /* arg 4 low 32 bits */
210 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(4)),
211 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* and_13 */ 0, /* sendto_KILL */ 2 ),
212 : // and_13:
213 : /* arg 5 low 32 bits */
214 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(5)),
215 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* sendto_ALLOW */ 1, /* sendto_KILL */ 0 ),
216 : // sendto_KILL:
217 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
218 : // sendto_ALLOW:
219 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
220 : // check_recvfrom:
221 : /* arg 0 low 32 bits */
222 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
223 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(logfile_fd)), /* recvfrom_KILL */ 18, /* or_16 */ 0 ),
224 : // or_16:
225 : /* arg 0 low 32 bits */
226 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
227 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(in_genesis_fd)), /* recvfrom_KILL */ 16, /* or_17 */ 0 ),
228 : // or_17:
229 : /* arg 0 low 32 bits */
230 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
231 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_dir_fd)), /* recvfrom_KILL */ 14, /* or_18 */ 0 ),
232 : // or_18:
233 : /* arg 0 low 32 bits */
234 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
235 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_genesis_fd)), /* recvfrom_KILL */ 12, /* or_19 */ 0 ),
236 : // or_19:
237 : /* arg 0 low 32 bits */
238 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
239 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000002U, /* recvfrom_KILL */ 10, /* and_15 */ 0 ),
240 : // and_15:
241 : /* arg 3 low 32 bits */
242 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(3)),
243 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* and_20 */ 0, /* recvfrom_KILL */ 8 ),
244 : // and_20:
245 : /* arg 4 high 32 bits */
246 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_HI_OFFSET(4)),
247 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* arg_hi_eq_22 */ 0, /* recvfrom_KILL */ 6 ),
248 : // arg_hi_eq_22:
249 : /* arg 4 low 32 bits */
250 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(4)),
251 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* and_21 */ 0, /* recvfrom_KILL */ 4 ),
252 : // and_21:
253 : /* arg 5 high 32 bits */
254 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_HI_OFFSET(5)),
255 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* arg_hi_eq_23 */ 0, /* recvfrom_KILL */ 2 ),
256 : // arg_hi_eq_23:
257 : /* arg 5 low 32 bits */
258 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(5)),
259 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* recvfrom_ALLOW */ 1, /* recvfrom_KILL */ 0 ),
260 : // recvfrom_KILL:
261 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
262 : // recvfrom_ALLOW:
263 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
264 : // check_renameat2:
265 : /* arg 0 low 32 bits */
266 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
267 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_dir_fd)), /* and_24 */ 0, /* renameat2_KILL */ 2 ),
268 : // and_24:
269 : /* arg 2 low 32 bits */
270 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(2)),
271 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(out_dir_fd)), /* renameat2_ALLOW */ 1, /* renameat2_KILL */ 0 ),
272 : // renameat2_KILL:
273 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
274 : // renameat2_ALLOW:
275 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
276 : // check_epoll_ctl:
277 : /* arg 0 low 32 bits */
278 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
279 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(epoll_inner_fd)), /* epoll_ctl_ALLOW */ 5, /* or_25 */ 0 ),
280 : // or_25:
281 : /* arg 0 low 32 bits */
282 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(0)),
283 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(epoll_outer_fd)), /* and_26 */ 0, /* epoll_ctl_KILL */ 2 ),
284 : // and_26:
285 : /* arg 2 low 32 bits */
286 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(2)),
287 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, ((uint)(epoll_inner_fd)), /* epoll_ctl_ALLOW */ 1, /* epoll_ctl_KILL */ 0 ),
288 : // epoll_ctl_KILL:
289 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
290 : // epoll_ctl_ALLOW:
291 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
292 : // check_futex:
293 : /* arg 1 low 32 bits */
294 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(1)),
295 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, FD_SECCOMP_ARG_LO(FUTEX_WAIT_BITSET), /* and_27 */ 0, /* futex_KILL */ 2 ),
296 : // and_27:
297 : /* arg 2 low 32 bits */
298 0 : BPF_STMT( BPF_LD | BPF_W | BPF_ABS, FD_SECCOMP_ARG_LO_OFFSET(2)),
299 0 : BPF_JUMP( BPF_JMP | BPF_JEQ | BPF_K, 0x00000000U, /* futex_ALLOW */ 1, /* futex_KILL */ 0 ),
300 : // futex_KILL:
301 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS ),
302 : // futex_ALLOW:
303 0 : BPF_STMT( BPF_RET | BPF_K, SECCOMP_RET_ALLOW ),
304 0 : };
305 0 : fd_memcpy( out, filter, sizeof( filter ) );
306 0 : }
307 :
308 : #endif /* defined(__linux__) */
309 :
310 : #endif /* HEADER_fd_src_discof_genesis_generated_fd_genesi_tile_seccomp_h */
|