selftests/bpf: fix a typo in map in map test
authorRoman Gushchin <guro@fb.com>
Thu, 2 Aug 2018 22:47:10 +0000 (15:47 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 3 Aug 2018 08:15:32 +0000 (10:15 +0200)
Commit fbeb1603bf4e ("bpf: verifier: MOV64 don't mark dst reg unbounded")
revealed a typo in commit fb30d4b71214 ("bpf: Add tests for map-in-map"):
BPF_MOV64_REG(BPF_REG_0, 0) was used instead of
BPF_MOV64_IMM(BPF_REG_0, 0).

I've noticed the problem by running bpf kselftests.

Fixes: fb30d4b71214 ("bpf: Add tests for map-in-map")
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Arthur Fabre <afabre@cloudflare.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_verifier.c

index 4b5e03c25204b0a2adef2c99a20f915bd39d0b6e..ac281ee771dd86f62893c7d89fa4651eab29f392 100644 (file)
@@ -7113,7 +7113,7 @@ static struct bpf_test tests[] = {
                        BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
                        BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
                                     BPF_FUNC_map_lookup_elem),
-                       BPF_MOV64_REG(BPF_REG_0, 0),
+                       BPF_MOV64_IMM(BPF_REG_0, 0),
                        BPF_EXIT_INSN(),
                },
                .fixup_map_in_map = { 3 },
@@ -7136,7 +7136,7 @@ static struct bpf_test tests[] = {
                        BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, 8),
                        BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
                                     BPF_FUNC_map_lookup_elem),
-                       BPF_MOV64_REG(BPF_REG_0, 0),
+                       BPF_MOV64_IMM(BPF_REG_0, 0),
                        BPF_EXIT_INSN(),
                },
                .fixup_map_in_map = { 3 },
@@ -7158,7 +7158,7 @@ static struct bpf_test tests[] = {
                        BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
                        BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
                                     BPF_FUNC_map_lookup_elem),
-                       BPF_MOV64_REG(BPF_REG_0, 0),
+                       BPF_MOV64_IMM(BPF_REG_0, 0),
                        BPF_EXIT_INSN(),
                },
                .fixup_map_in_map = { 3 },