mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
bpftool: Fix printing incorrect pointer in btf_dump_ptr
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: 22c349e8db ("tools: bpftool: fix format strings and arguments for jsonw_printf()")
Signed-off-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
4921b2b1ca
commit
2548a72a6f
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ static void btf_dumper_ptr(const void *data, json_writer_t *jw,
|
|||
bool is_plain_text)
|
||||
{
|
||||
if (is_plain_text)
|
||||
jsonw_printf(jw, "%p", data);
|
||||
jsonw_printf(jw, "%p", *(void **)data);
|
||||
else
|
||||
jsonw_printf(jw, "%lu", *(unsigned long *)data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue