Skip to content

Commit

Permalink
selftests/bpf: Fix invalid memory reads in core_relo selftest
Browse files Browse the repository at this point in the history
Another one found by AddressSanitizer. input_len is bigger than actually
initialized data size.

Fixes: c7566a6 ("selftests/bpf: Add field existence CO-RE relocs tests")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
anakryiko authored and Alexei Starovoitov committed Apr 29, 2020
1 parent 9f56bb5 commit 13c9084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/core_reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static struct core_reloc_test_case test_cases[] = {
.input = STRUCT_TO_CHAR_PTR(core_reloc_existence___minimal) {
.a = 42,
},
.input_len = sizeof(struct core_reloc_existence),
.input_len = sizeof(struct core_reloc_existence___minimal),
.output = STRUCT_TO_CHAR_PTR(core_reloc_existence_output) {
.a_exists = 1,
.b_exists = 0,
Expand Down

0 comments on commit 13c9084

Please sign in to comment.