]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Fix printing incorrect pointer in btf_dump_ptr
authorMartin KaFai Lau <kafai@fb.com>
Fri, 10 Jan 2020 23:16:44 +0000 (15:16 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 12 Jan 2020 03:08:21 +0000 (19:08 -0800)
commit9a1b72ba98ac6f25f9e20a13389ea886cdb9f3c4
tree49325ac48be165288896658c354b0bad03c5118a
parent2c48dc8e1dd984e980b1664c4010feece35fba45
bpftool: Fix printing incorrect pointer in btf_dump_ptr

For plain text output, it incorrectly prints the pointer value
"void *data".  The "void *data" is actually pointing to memory that
contains a bpf-map's value.  The intention is to print the content of
the bpf-map's value instead of printing the pointer pointing to the
bpf-map's value.

In this case, a member of the bpf-map's value is a pointer type.
Thus, it should print the "*(void **)data".

Fixes: d275970b8ab2 ("tools: bpftool: fix format strings and arguments for jsonw_printf()")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Link: https://lore.kernel.org/bpf/20200110231644.3484151-1-kafai@fb.com
tools/bpf/bpftool/btf_dumper.c