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
commit4e4baf67dc2ee65b7b2ea31064275f402554356c (patch)
treee7962157695c91163c9dae1458a89c7ee9dc807e
parent2115d08ae82318173a5ff73fc2522d70227a76c5 (diff)
tools: bpftool: fix arguments for p_err() in do_event_pipe()
(bsc#1155518).
-rw-r--r--patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch41
-rw-r--r--series.conf1
2 files changed, 42 insertions, 0 deletions
diff --git a/patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch b/patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch
new file mode 100644
index 0000000000..e15bec958c
--- /dev/null
+++ b/patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch
@@ -0,0 +1,41 @@
+From: Quentin Monnet <quentin.monnet@netronome.com>
+Date: Thu, 15 Aug 2019 15:32:15 +0100
+Subject: tools: bpftool: fix arguments for p_err() in do_event_pipe()
+Patch-mainline: v5.4-rc1
+Git-commit: 9def249dc8409ffc1f5a1d7195f1c462f2b49c07
+References: bsc#1155518
+
+The last argument passed to some calls to the p_err() functions is not
+correct, it should be "*argv" instead of "**argv". This may lead to a
+segmentation fault error if CPU IDs or indices from the command line
+cannot be parsed correctly. Let's fix this.
+
+Fixes: f412eed9dfde ("tools: bpftool: add simple perf event output reader")
+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/map_perf_ring.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/tools/bpf/bpftool/map_perf_ring.c
++++ b/tools/bpf/bpftool/map_perf_ring.c
+@@ -157,7 +157,7 @@ int do_event_pipe(int argc, char **argv)
+ NEXT_ARG();
+ ctx.cpu = strtoul(*argv, &endptr, 0);
+ if (*endptr) {
+- p_err("can't parse %s as CPU ID", **argv);
++ p_err("can't parse %s as CPU ID", *argv);
+ goto err_close_map;
+ }
+
+@@ -168,7 +168,7 @@ int do_event_pipe(int argc, char **argv)
+ NEXT_ARG();
+ ctx.idx = strtoul(*argv, &endptr, 0);
+ if (*endptr) {
+- p_err("can't parse %s as index", **argv);
++ p_err("can't parse %s as index", *argv);
+ goto err_close_map;
+ }
+
diff --git a/series.conf b/series.conf
index 8a07a91ab3..3aa7d6e5c9 100644
--- a/series.conf
+++ b/series.conf
@@ -1088,6 +1088,7 @@
patches.suse/net-hns3-make-hclge_dbg_get_m7_stats_info-static.patch
patches.suse/tools-bpftool-compile-with-EXTRA_WARNINGS.patch
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/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