1 // SPDX-License-Identifier: GPL-2.0
2 /* Converted from tools/testing/selftests/bpf/verifier/masking.c */
5 #include <bpf/bpf_helpers.h>
9 __description("masking, test out of bounds 1")
10 __success __success_unpriv __retval(0)
11 __naked void test_out_of_bounds_1(void)
24 : __imm_const(__imm_0, 5 - 1)
29 __description("masking, test out of bounds 2")
30 __success __success_unpriv __retval(0)
31 __naked void test_out_of_bounds_2(void)
44 : __imm_const(__imm_0, 1 - 1)
49 __description("masking, test out of bounds 3")
50 __success __success_unpriv __retval(0)
51 __naked void test_out_of_bounds_3(void)
64 : __imm_const(__imm_0, 0xffffffff - 1)
69 __description("masking, test out of bounds 4")
70 __success __success_unpriv __retval(0)
71 __naked void test_out_of_bounds_4(void)
84 : __imm_const(__imm_0, 1 - 1)
89 __description("masking, test out of bounds 5")
90 __success __success_unpriv __retval(0)
91 __naked void test_out_of_bounds_5(void)
104 : __imm_const(__imm_0, 1 - 1)
109 __description("masking, test out of bounds 6")
110 __success __success_unpriv __retval(0)
111 __naked void test_out_of_bounds_6(void)
124 : __imm_const(__imm_0, 0xffffffff - 1)
129 __description("masking, test out of bounds 7")
130 __success __success_unpriv __retval(0)
131 __naked void test_out_of_bounds_7(void)
144 : __imm_const(__imm_0, 5 - 1)
149 __description("masking, test out of bounds 8")
150 __success __success_unpriv __retval(0)
151 __naked void test_out_of_bounds_8(void)
164 : __imm_const(__imm_0, 1 - 1)
169 __description("masking, test out of bounds 9")
170 __success __success_unpriv __retval(0)
171 __naked void test_out_of_bounds_9(void)
184 : __imm_const(__imm_0, 0xffffffff - 1)
189 __description("masking, test out of bounds 10")
190 __success __success_unpriv __retval(0)
191 __naked void test_out_of_bounds_10(void)
204 : __imm_const(__imm_0, 1 - 1)
209 __description("masking, test out of bounds 11")
210 __success __success_unpriv __retval(0)
211 __naked void test_out_of_bounds_11(void)
224 : __imm_const(__imm_0, 1 - 1)
229 __description("masking, test out of bounds 12")
230 __success __success_unpriv __retval(0)
231 __naked void test_out_of_bounds_12(void)
244 : __imm_const(__imm_0, 0xffffffff - 1)
249 __description("masking, test in bounds 1")
250 __success __success_unpriv __retval(4)
251 __naked void masking_test_in_bounds_1(void)
264 : __imm_const(__imm_0, 5 - 1)
269 __description("masking, test in bounds 2")
270 __success __success_unpriv __retval(0)
271 __naked void masking_test_in_bounds_2(void)
284 : __imm_const(__imm_0, 0xffffffff - 1)
289 __description("masking, test in bounds 3")
290 __success __success_unpriv __retval(0xfffffffe)
291 __naked void masking_test_in_bounds_3(void)
304 : __imm_const(__imm_0, 0xffffffff - 1)
309 __description("masking, test in bounds 4")
310 __success __success_unpriv __retval(0xabcde)
311 __naked void masking_test_in_bounds_4(void)
324 : __imm_const(__imm_0, 0xabcdef - 1)
329 __description("masking, test in bounds 5")
330 __success __success_unpriv __retval(0)
331 __naked void masking_test_in_bounds_5(void)
344 : __imm_const(__imm_0, 1 - 1)
349 __description("masking, test in bounds 6")
350 __success __success_unpriv __retval(46)
351 __naked void masking_test_in_bounds_6(void)
364 : __imm_const(__imm_0, 47 - 1)
369 __description("masking, test in bounds 7")
370 __success __success_unpriv __retval(46)
371 __naked void masking_test_in_bounds_7(void)
385 : __imm_const(__imm_0, 47 - 1)
390 __description("masking, test in bounds 8")
391 __success __success_unpriv __retval(0)
392 __naked void masking_test_in_bounds_8(void)
406 : __imm_const(__imm_0, 47 - 1)
410 char _license[] SEC("license") = "GPL";