Skip to content

Commit

Permalink
selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldi…
Browse files Browse the repository at this point in the history
…mm64

Commit 4976b71 ("bpf: Introduce pseudo_btf_id") switched
the order of check_subprogs() and resolve_pseudo_ldimm() in
the verifier. Now an empty prog expects to see the error "last
insn is not an the prog of a single invalid ldimm exit or jmp"
instead, because the check for subprogs comes first. It's now
pointless to validate that half of ldimm64 won't be the last
instruction.

Tested:
 # ./test_verifier
 Summary: 1129 PASSED, 537 SKIPPED, 0 FAILED
 and the full set of bpf selftests.

Fixes: 4976b71 ("bpf: Introduce pseudo_btf_id")
Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201007022857.2791884-1-haoluo@google.com
  • Loading branch information
Hao Luo authored and Alexei Starovoitov committed Oct 7, 2020
1 parent 67ed375 commit bf88a80
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/verifier/basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"empty prog",
.insns = {
},
.errstr = "unknown opcode 00",
.errstr = "last insn is not an exit or jmp",
.result = REJECT,
},
{
Expand Down
8 changes: 0 additions & 8 deletions tools/testing/selftests/bpf/verifier/ld_imm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@
.errstr = "invalid bpf_ld_imm64 insn",
.result = REJECT,
},
{
"test5 ld_imm64",
.insns = {
BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
},
.errstr = "invalid bpf_ld_imm64 insn",
.result = REJECT,
},
{
"test6 ld_imm64",
.insns = {
Expand Down

0 comments on commit bf88a80

Please sign in to comment.