summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp
diff options
context:
space:
mode:
authorDaniel Díaz <daniel.diaz@linaro.org>2019-02-25 16:02:52 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-26 23:04:31 +0000
commit9ea8ca7f62ea5e9865f871ef79337b2fa9867cdc (patch)
treee5f2b788b75b585bb55409769392cbd0f4032b0d /meta/recipes-extended/ltp
parentce9a6606d7791320502383f92cf4d9935f09a2b3 (diff)
downloadpoky-9ea8ca7f62ea5e9865f871ef79337b2fa9867cdc.tar.gz
ltp: Add patch for string formatting security warning
A revamp of the syscalls/setregid tests made to use a new library [LTP:7a1b4427] required a conversion to test messages. This test in particular did not include a formatted string, but a just a string element: testcases/kernel/syscalls/setregid/setregid01.c This patch allows LTP to be built with -Wformat, -Wformat-security, and -Werror=format-security. (From OE-Core rev: ecee899dec53d324053112ed8764268fef930408) Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ltp')
-rw-r--r--meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch46
-rw-r--r--meta/recipes-extended/ltp/ltp_20190115.bb6
2 files changed, 47 insertions, 5 deletions
diff --git a/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch b/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch
new file mode 100644
index 0000000000..24449148f2
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch
@@ -0,0 +1,46 @@
1From 430e05c2169ed15aaa6d7f9459edd607603cee02 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
3Date: Mon, 25 Feb 2019 10:44:33 -0600
4Subject: [PATCH] setregid01: Fix security warning for string formatting
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9GCC 8.2.0 complains with the following:
10 setregid01.c: In function 'run':
11 setregid01.c:47:3: error: format not a string literal and no format arguments [-Werror=format-security]
12 tst_res(TFAIL | TTERRNO, tc->msg);
13 ^~~~~~~
14because there is no string formatting in the message. This can
15be seen with CFLAGS set to:
16 -Wformat -Wformat-security -Werror=format-security
17as Yocto Project's Poky does, e.g.:
18 http://errors.yoctoproject.org/Errors/Details/230043/
19
20Upstream-Status: Backport [46e1eda55f188810e6bf3a939b92d604321807ae]
21
22Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
23Reviewed-by: Enji Cooper <yaneurabeya@gmail.com>
24---
25 testcases/kernel/syscalls/setregid/setregid01.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28diff --git a/testcases/kernel/syscalls/setregid/setregid01.c b/testcases/kernel/syscalls/setregid/setregid01.c
29index f2e41e134..8c9e11918 100644
30--- a/testcases/kernel/syscalls/setregid/setregid01.c
31+++ b/testcases/kernel/syscalls/setregid/setregid01.c
32@@ -44,9 +44,9 @@ static void run(unsigned int n)
33 TEST(SETREGID(*tc->arg1, *tc->arg2));
34
35 if (TST_RET == -1)
36- tst_res(TFAIL | TTERRNO, tc->msg);
37+ tst_res(TFAIL | TTERRNO, "%s", tc->msg);
38 else
39- tst_res(TPASS, tc->msg);
40+ tst_res(TPASS, "%s", tc->msg);
41 }
42
43 static void setup(void)
44--
452.17.1
46
diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190115.bb
index ed1cb27112..ddf97e26ce 100644
--- a/meta/recipes-extended/ltp/ltp_20190115.bb
+++ b/meta/recipes-extended/ltp/ltp_20190115.bb
@@ -29,11 +29,6 @@ CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
30SRCREV = "a6a5caef13632e669dda27b0461726eba546a2f3" 30SRCREV = "a6a5caef13632e669dda27b0461726eba546a2f3"
31 31
32# ltp doesn't currently build cleanly with
33# "-Wformat -Wformat-security -Werror=format-security" in CFLAGS
34# remove this when it does
35SECURITY_STRINGFORMAT = ""
36
37SRC_URI = "git://github.com/linux-test-project/ltp.git \ 32SRC_URI = "git://github.com/linux-test-project/ltp.git \
38 file://0004-build-Add-option-to-select-libc-implementation.patch \ 33 file://0004-build-Add-option-to-select-libc-implementation.patch \
39 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ 34 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
@@ -53,6 +48,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
53 file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \ 48 file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \
54 file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ 49 file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
55 file://define-sigrtmin-and-sigrtmax-for-musl.patch \ 50 file://define-sigrtmin-and-sigrtmax-for-musl.patch \
51 file://setregid01-security-string-formatting.patch \
56 " 52 "
57 53
58S = "${WORKDIR}/git" 54S = "${WORKDIR}/git"