summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-05-19 22:26:34 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-21 10:49:12 +0100
commit3be441f12c790cefb0e2f7e9c88a920f03787719 (patch)
tree69aa61e8d6f93d873c326dda4089601a979a8511
parentb31adfccbcdf88f2a9cdca59dcb4725356d30a7f (diff)
downloadopenembedded-core-3be441f12c790cefb0e2f7e9c88a920f03787719.tar.gz
openembedded-core-3be441f12c790cefb0e2f7e9c88a920f03787719.tar.bz2
openembedded-core-3be441f12c790cefb0e2f7e9c88a920f03787719.zip
ltp: Fix format security warnings with gcc10
Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Petr Vorel <petr.vorel@gmail.com> Cc: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-ptrace01-Fix-missing-format-string.patch33
-rw-r--r--meta/recipes-extended/ltp/ltp_20200515.bb1
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-ptrace01-Fix-missing-format-string.patch b/meta/recipes-extended/ltp/ltp/0001-ptrace01-Fix-missing-format-string.patch
new file mode 100644
index 0000000000..27b890e22b
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-ptrace01-Fix-missing-format-string.patch
@@ -0,0 +1,33 @@
+From adb9587466a493fdd9d4410f1b8b130ebca06daa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 May 2020 22:21:23 -0700
+Subject: [PATCH] ptrace01: Fix missing format string
+
+Fixes
+| ptrace01.c:89:2: error: format string is not a string literal
+(potentially insecure) [-Werror,-Wformat-security]
+| tst_res(TINFO, tc->message);
+| ^ ~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [58424835952641f4fd60c0ae3ab6c64decca3f8a]
+---
+ testcases/kernel/syscalls/ptrace/ptrace01.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/ptrace/ptrace01.c b/testcases/kernel/syscalls/ptrace/ptrace01.c
+index 87a99e4150..9071bbabaf 100644
+--- a/testcases/kernel/syscalls/ptrace/ptrace01.c
++++ b/testcases/kernel/syscalls/ptrace/ptrace01.c
+@@ -86,7 +86,7 @@ static void run(unsigned int i)
+
+ got_signal = 0;
+
+- tst_res(TINFO, tc->message);
++ tst_res(TINFO, "%s", tc->message);
+
+ if (tc->handler == 1) {
+ parent_act.sa_handler = parent_handler;
+--
+2.26.2
+
diff --git a/meta/recipes-extended/ltp/ltp_20200515.bb b/meta/recipes-extended/ltp/ltp_20200515.bb
index 37bad53766..e82f6b33a1 100644
--- a/meta/recipes-extended/ltp/ltp_20200515.bb
+++ b/meta/recipes-extended/ltp/ltp_20200515.bb
@@ -34,6 +34,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
file://0004-guard-mallocopt-with-__GLIBC__.patch \
file://0007-Fix-test_proc_kill-hanging.patch \
file://0001-Add-more-musl-exclusions.patch \
+ file://0001-ptrace01-Fix-missing-format-string.patch \
"
S = "${WORKDIR}/git"