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:38 +0800
commit69b6cc62374d7a41ffa09a281e149907ad50f766 (patch)
treea953c82d07c4dc4435874a1e2e68f694d118b17c
parent40c1f13488f8c12d2cc2fc85fe365305a094f6b1 (diff)
tools: bpftool: fix format string for p_err() in
detect_common_prefix() (bsc#1155518).
-rw-r--r--patches.suse/tools-bpftool-fix-format-string-for-p_err-in-detect_.patch34
-rw-r--r--series.conf1
2 files changed, 35 insertions, 0 deletions
diff --git a/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-detect_.patch b/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-detect_.patch
new file mode 100644
index 0000000000..9cfc8426a5
--- /dev/null
+++ b/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-detect_.patch
@@ -0,0 +1,34 @@
+From: Quentin Monnet <quentin.monnet@netronome.com>
+Date: Thu, 15 Aug 2019 15:32:19 +0100
+Subject: tools: bpftool: fix format string for p_err() in
+ detect_common_prefix()
+Patch-mainline: v5.4-rc1
+Git-commit: b0ead6d75a5b335287337e602e6b815e1115481c
+References: bsc#1155518
+
+There is one call to the p_err() function in detect_common_prefix()
+where the message to print is passed directly as the first argument,
+without using a format string. This is harmless, but may trigger
+warnings if the "__printf()" attribute is used correctly for the p_err()
+function. Let's fix it by using a "%s" format string.
+
+Fixes: ba95c7452439 ("tools: bpftool: add "prog run" subcommand to test-run programs")
+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/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/bpf/bpftool/main.c
++++ b/tools/bpf/bpftool/main.c
+@@ -139,7 +139,7 @@ int detect_common_prefix(const char *arg
+ strncat(msg, "'", sizeof(msg) - strlen(msg) - 1);
+
+ if (count >= 2) {
+- p_err(msg);
++ p_err("%s", msg);
+ return -1;
+ }
+
diff --git a/series.conf b/series.conf
index bbc21f9ee7..f68540abca 100644
--- a/series.conf
+++ b/series.conf
@@ -1092,6 +1092,7 @@
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/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch
+ patches.suse/tools-bpftool-fix-format-string-for-p_err-in-detect_.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