WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / uninit.c
blob987a5871ff1df719ee1ff486b77395659f885d4c
2 "read uninitialized register",
3 .insns = {
4 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
5 BPF_EXIT_INSN(),
6 },
7 .errstr = "R2 !read_ok",
8 .result = REJECT,
9 },
11 "read invalid register",
12 .insns = {
13 BPF_MOV64_REG(BPF_REG_0, -1),
14 BPF_EXIT_INSN(),
16 .errstr = "R15 is invalid",
17 .result = REJECT,
20 "program doesn't init R0 before exit",
21 .insns = {
22 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
23 BPF_EXIT_INSN(),
25 .errstr = "R0 !read_ok",
26 .result = REJECT,
29 "program doesn't init R0 before exit in all branches",
30 .insns = {
31 BPF_JMP_IMM(BPF_JGE, BPF_REG_1, 0, 2),
32 BPF_MOV64_IMM(BPF_REG_0, 1),
33 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 2),
34 BPF_EXIT_INSN(),
36 .errstr = "R0 !read_ok",
37 .errstr_unpriv = "R1 pointer comparison",
38 .result = REJECT,