0001 {
0002 "read uninitialized register",
0003 .insns = {
0004 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
0005 BPF_EXIT_INSN(),
0006 },
0007 .errstr = "R2 !read_ok",
0008 .result = REJECT,
0009 },
0010 {
0011 "read invalid register",
0012 .insns = {
0013 BPF_MOV64_REG(BPF_REG_0, -1),
0014 BPF_EXIT_INSN(),
0015 },
0016 .errstr = "R15 is invalid",
0017 .result = REJECT,
0018 },
0019 {
0020 "program doesn't init R0 before exit",
0021 .insns = {
0022 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
0023 BPF_EXIT_INSN(),
0024 },
0025 .errstr = "R0 !read_ok",
0026 .result = REJECT,
0027 },
0028 {
0029 "program doesn't init R0 before exit in all branches",
0030 .insns = {
0031 BPF_JMP_IMM(BPF_JGE, BPF_REG_1, 0, 2),
0032 BPF_MOV64_IMM(BPF_REG_0, 1),
0033 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 2),
0034 BPF_EXIT_INSN(),
0035 },
0036 .errstr = "R0 !read_ok",
0037 .errstr_unpriv = "R1 pointer comparison",
0038 .result = REJECT,
0039 },