summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch113
-rw-r--r--meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch36
-rw-r--r--meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch34
-rw-r--r--meta/recipes-extended/ltp/ltp_20170929.bb (renamed from meta/recipes-extended/ltp/ltp_20170516.bb)5
4 files changed, 38 insertions, 150 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
deleted file mode 100644
index c8738ae0d4..0000000000
--- a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
+++ /dev/null
@@ -1,113 +0,0 @@
1From a9d5595d2fa2ab252f1cabf63f4b65c3efbafeb9 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 10 Aug 2017 15:27:03 +0800
4Subject: [PATCH] ltp: fix PAGE_SIZE redefinition and O_CREAT undeclear when
5 build with musl
6
7error 1:
8
9|stack_clash.c:50:22: error: expected identifier or '(' before numeric constant
10| static unsigned long PAGE_SIZE;
11
12This is because the musl libc already contain PAGE_SIZE definition in limits.c,
13we can check it here:
14
15 https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n43
16
17error 2:
18
19|ck01.c:157:22: error: 'O_CREAT' undeclared (first use in this function); did you mean 'S_IREAD'?
20| fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0644);
21| ^~~~~~~
22| S_IREAD
23
24This is because the musl libc put those in fcntl.h, so we should include that
25file.
26
27Upstream-Status: Submitted [ https://github.com/linux-test-project/ltp/pull/194 ]
28
29Signed-off-by: Dengke Du <dengke.du@windriver.com>
30---
31 testcases/cve/stack_clash.c | 12 ++++++------
32 testcases/kernel/syscalls/flock/flock01.c | 1 +
33 testcases/kernel/syscalls/flock/flock02.c | 1 +
34 3 files changed, 8 insertions(+), 6 deletions(-)
35
36diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c
37index 2ef1a82..7c45991 100644
38--- a/testcases/cve/stack_clash.c
39+++ b/testcases/cve/stack_clash.c
40@@ -47,7 +47,7 @@
41 #include "tst_test.h"
42 #include "tst_safe_stdio.h"
43
44-static unsigned long PAGE_SIZE;
45+static unsigned long PAGE_SIZE_tst;
46 static unsigned long PAGE_MASK;
47 static unsigned long GAP_PAGES = 256;
48 static unsigned long THRESHOLD;
49@@ -66,7 +66,7 @@ void exhaust_stack_into_sigsegv(void)
50 exhaust_stack_into_sigsegv();
51 }
52
53-#define MAPPED_LEN PAGE_SIZE
54+#define MAPPED_LEN PAGE_SIZE_tst
55 static unsigned long mapped_addr;
56
57 void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED)
58@@ -150,7 +150,7 @@ void do_child(void)
59 stack_t signal_stack;
60 struct sigaction segv_sig = {.sa_sigaction = segv_handler, .sa_flags = SA_ONSTACK|SA_SIGINFO};
61 void *map;
62- unsigned long gap = GAP_PAGES * PAGE_SIZE;
63+ unsigned long gap = GAP_PAGES * PAGE_SIZE_tst;
64 struct rlimit rlimit;
65
66 rlimit.rlim_cur = rlimit.rlim_max = RLIM_INFINITY;
67@@ -200,8 +200,8 @@ void setup(void)
68 {
69 char buf[4096], *p;
70
71- PAGE_SIZE = sysconf(_SC_PAGESIZE);
72- PAGE_MASK = ~(PAGE_SIZE - 1);
73+ PAGE_SIZE_tst = sysconf(_SC_PAGESIZE);
74+ PAGE_MASK = ~(PAGE_SIZE_tst - 1);
75
76 buf[4095] = '\0';
77 SAFE_FILE_SCANF("/proc/cmdline", "%4095[^\n]", buf);
78@@ -214,7 +214,7 @@ void setup(void)
79 tst_res(TINFO, "stack_guard_gap = %ld", GAP_PAGES);
80 }
81
82- THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE;
83+ THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE_tst;
84
85 {
86 volatile int *a = alloca(128);
87diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c
88index 3e17be4..06d89e3 100644
89--- a/testcases/kernel/syscalls/flock/flock01.c
90+++ b/testcases/kernel/syscalls/flock/flock01.c
91@@ -69,6 +69,7 @@
92 #include <stdio.h>
93 #include <sys/wait.h>
94 #include <sys/file.h>
95+#include <fcntl.h>
96 #include "test.h"
97
98 void setup(void);
99diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c
100index 414df68..9ddf729 100644
101--- a/testcases/kernel/syscalls/flock/flock02.c
102+++ b/testcases/kernel/syscalls/flock/flock02.c
103@@ -75,6 +75,7 @@
104 #include <sys/types.h>
105 #include <sys/file.h>
106 #include <sys/wait.h>
107+#include <fcntl.h>
108 #include <errno.h>
109 #include <stdio.h>
110 #include "test.h"
111--
1122.7.4
113
diff --git a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch
new file mode 100644
index 0000000000..44d699051b
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch
@@ -0,0 +1,36 @@
1From 8eb3e111ae1b89e5afb249cf984d657f94da2385 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Tue, 17 Oct 2017 05:42:47 -0400
4Subject: [PATCH] ltp: fix format security error
5
6When enable option: -Werror=format-security, the error like:
7
8 | fcntl36.c: In function 'test_fn':
9 | fcntl36.c:303:2: error: format not a string literal and no format arguments [-Werror=format-security]
10 | tst_res(TINFO, msg);
11 | ^~~~~~~
12 | cc1: some warnings being treated as errors
13
14Upstream-Status: Pending
15
16Signed-off-by: Dengke Du <dengke.du@windriver.com>
17---
18 testcases/kernel/syscalls/fcntl/fcntl36.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c
22index 6f2eb6b..3246d13 100644
23--- a/testcases/kernel/syscalls/fcntl/fcntl36.c
24+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c
25@@ -300,7 +300,7 @@ static void test_fn(void *f0(void *), void *f1(void *),
26 struct param p2[thread_cnt];
27 unsigned char buf[write_size];
28
29- tst_res(TINFO, msg);
30+ tst_res(TINFO, "%s", msg);
31
32 if (tst_fill_file(fname, 1, write_size, thread_cnt + 1))
33 tst_brk(TBROK, "Failed to create tst file");
34--
352.8.1
36
diff --git a/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch b/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch
deleted file mode 100644
index f7c0a4bf17..0000000000
--- a/meta/recipes-extended/ltp/ltp/0038-commands-gdb01-replace-stdin-with-dev-null.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 2f6ab8f694b26b7f2566624f6d1f23788d6ab8a0 Mon Sep 17 00:00:00 2001
2From: Jan Stancek <jstancek@redhat.com>
3Date: Mon, 11 Sep 2017 12:57:58 +0200
4Subject: [PATCH] commands/gdb01: replace stdin with /dev/null
5
6If this testcase runs as background process, gdb can receive
7SIGTTOU and then testcase gets stuck.
8
9Signed-off-by: Jan Stancek <jstancek@redhat.com>
10
11Upstream-Status: Backport
12[https://github.com/linux-test-project/ltp/commit/2f6ab8f694b26b7f2566624f6d1f23788d6ab8a0]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 testcases/commands/gdb/gdb01.sh | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/testcases/commands/gdb/gdb01.sh b/testcases/commands/gdb/gdb01.sh
20index 07ae36f..e3a5b51 100755
21--- a/testcases/commands/gdb/gdb01.sh
22+++ b/testcases/commands/gdb/gdb01.sh
23@@ -29,7 +29,7 @@ TST_NEEDS_CMDS="gdb /bin/cat"
24
25 simple_test()
26 {
27- gdb /bin/cat -ex "run /etc/passwd" -ex quit
28+ gdb /bin/cat -ex "run /etc/passwd" -ex quit < /dev/null
29 RC=$?
30 if [ $RC -eq 0 ] ; then
31 tst_res TPASS "gdb attached to process and completed run"
32--
332.7.4
34
diff --git a/meta/recipes-extended/ltp/ltp_20170516.bb b/meta/recipes-extended/ltp/ltp_20170929.bb
index 653cbfd4ed..93a59b31bd 100644
--- a/meta/recipes-extended/ltp/ltp_20170516.bb
+++ b/meta/recipes-extended/ltp/ltp_20170929.bb
@@ -21,7 +21,7 @@ DEPENDS_append_libc-musl = " fts "
21EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " 21EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
22CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" 22CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
23CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 23CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
24SRCREV = "18916a2e6d8c997b7b29dcfa9550d5a15b22ed22" 24SRCREV = "bac930f71b1e6786ebb8a894463503d07681ef6a"
25 25
26SRC_URI = "git://github.com/linux-test-project/ltp.git \ 26SRC_URI = "git://github.com/linux-test-project/ltp.git \
27 file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \ 27 file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \
@@ -48,8 +48,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
48 file://0034-periodic_output.patch \ 48 file://0034-periodic_output.patch \
49 file://0035-fix-test_proc_kill-hang.patch \ 49 file://0035-fix-test_proc_kill-hang.patch \
50 file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ 50 file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
51 file://0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch \ 51 file://0037-ltp-fix-format-security-error.patch \
52 file://0038-commands-gdb01-replace-stdin-with-dev-null.patch \
53 " 52 "
54 53
55S = "${WORKDIR}/git" 54S = "${WORKDIR}/git"