staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / runtime_jit.c
bloba9a8f620e71cd8b84d74e9142fe9cb959f02d0a6
2 "runtime/jit: tail_call within bounds, prog once",
3 .insns = {
4 BPF_MOV64_IMM(BPF_REG_3, 0),
5 BPF_LD_MAP_FD(BPF_REG_2, 0),
6 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
7 BPF_MOV64_IMM(BPF_REG_0, 1),
8 BPF_EXIT_INSN(),
9 },
10 .fixup_prog1 = { 1 },
11 .result = ACCEPT,
12 .retval = 42,
15 "runtime/jit: tail_call within bounds, prog loop",
16 .insns = {
17 BPF_MOV64_IMM(BPF_REG_3, 1),
18 BPF_LD_MAP_FD(BPF_REG_2, 0),
19 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
20 BPF_MOV64_IMM(BPF_REG_0, 1),
21 BPF_EXIT_INSN(),
23 .fixup_prog1 = { 1 },
24 .result = ACCEPT,
25 .retval = 41,
28 "runtime/jit: tail_call within bounds, no prog",
29 .insns = {
30 BPF_MOV64_IMM(BPF_REG_3, 2),
31 BPF_LD_MAP_FD(BPF_REG_2, 0),
32 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
33 BPF_MOV64_IMM(BPF_REG_0, 1),
34 BPF_EXIT_INSN(),
36 .fixup_prog1 = { 1 },
37 .result = ACCEPT,
38 .retval = 1,
41 "runtime/jit: tail_call out of bounds",
42 .insns = {
43 BPF_MOV64_IMM(BPF_REG_3, 256),
44 BPF_LD_MAP_FD(BPF_REG_2, 0),
45 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
46 BPF_MOV64_IMM(BPF_REG_0, 2),
47 BPF_EXIT_INSN(),
49 .fixup_prog1 = { 1 },
50 .result = ACCEPT,
51 .retval = 2,
54 "runtime/jit: pass negative index to tail_call",
55 .insns = {
56 BPF_MOV64_IMM(BPF_REG_3, -1),
57 BPF_LD_MAP_FD(BPF_REG_2, 0),
58 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
59 BPF_MOV64_IMM(BPF_REG_0, 2),
60 BPF_EXIT_INSN(),
62 .fixup_prog1 = { 1 },
63 .result = ACCEPT,
64 .retval = 2,
67 "runtime/jit: pass > 32bit index to tail_call",
68 .insns = {
69 BPF_LD_IMM64(BPF_REG_3, 0x100000000ULL),
70 BPF_LD_MAP_FD(BPF_REG_2, 0),
71 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tail_call),
72 BPF_MOV64_IMM(BPF_REG_0, 2),
73 BPF_EXIT_INSN(),
75 .fixup_prog1 = { 2 },
76 .result = ACCEPT,
77 .retval = 42,
78 /* Verifier rewrite for unpriv skips tail call here. */
79 .retval_unpriv = 2,