]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:26:29 +0000 (16:26 +0100)
commit304733d9801de507879a57144c4f26bcaefb5195
treef92e8fe84ef0c5e24e80e82c9bed9fc9a38cd30e
parent7a67e0ac391ac7bf1556b89de1f420e3338b60e9
bpftool: Fix printing incorrect pointer in btf_dump_ptr

BugLink: https://bugs.launchpad.net/bugs/1861090
commit 555089fdfc37ad65e0ee9b42ca40c238ff546f83 upstream.

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: 22c349e8db89 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
tools/bpf/bpftool/btf_dumper.c