Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2019-11-06 17:49:33 +0800
committerGary Lin <glin@suse.com>2019-11-06 17:49:37 +0800
commit917424f880a4d85fd985294d96b1c7bdb0525688 (patch)
tree7a44ab35bde252ec4d0914d795a44409a904682c
parent720fe8bcf2b4f817ca0ec7165e6f3a3a418322f0 (diff)
tools: bpftool: fix argument for p_err() in BTF do_dump()
(bsc#1155518).
-rw-r--r--patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch32
-rw-r--r--series.conf1
2 files changed, 33 insertions, 0 deletions
diff --git a/patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch b/patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch
new file mode 100644
index 0000000000..72bf9e0636
--- /dev/null
+++ b/patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch
@@ -0,0 +1,32 @@
+From: Quentin Monnet <quentin.monnet@netronome.com>
+Date: Thu, 15 Aug 2019 15:32:17 +0100
+Subject: tools: bpftool: fix argument for p_err() in BTF do_dump()
+Patch-mainline: v5.4-rc1
+Git-commit: ed4a3983cd3eb93aaf80de8d8a36efed808acff2
+References: bsc#1155518
+
+The last argument passed to one call to the p_err() function is not
+correct, it should be "*argv" instead of "**argv". This may lead to a
+segmentation fault error if BTF id cannot be parsed correctly. Let's fix
+this.
+
+Fixes: c93cc69004dt ("bpftool: add ability to dump BTF types")
+Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
+Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Acked-by: Gary Lin <glin@suse.com>
+---
+ tools/bpf/bpftool/btf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/bpf/bpftool/btf.c
++++ b/tools/bpf/bpftool/btf.c
+@@ -449,7 +449,7 @@ static int do_dump(int argc, char **argv
+
+ btf_id = strtoul(*argv, &endptr, 0);
+ if (*endptr) {
+- p_err("can't parse %s as ID", **argv);
++ p_err("can't parse %s as ID", *argv);
+ return -1;
+ }
+ NEXT_ARG();
diff --git a/series.conf b/series.conf
index a9d10d7810..ac86ab2fb6 100644
--- a/series.conf
+++ b/series.conf
@@ -1090,6 +1090,7 @@
patches.suse/libbpf-make-libbpf.map-source-of-truth-for-libbpf-ve.patch
patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch
patches.suse/tools-bpftool-fix-format-strings-and-arguments-for-j.patch
+ patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch
patches.suse/btf-fix-return-value-check-in-btf_vmlinux_init.patch
patches.suse/xsk-replace-ndo_xsk_async_xmit-with-ndo_xsk_wakeup.patch
patches.suse/xsk-add-support-for-need_wakeup-flag-in-AF_XDP-rings.patch