diff options
Diffstat (limited to 'external/poky/meta/recipes-extended/ltp/ltp')
29 files changed, 348 insertions, 1866 deletions
diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch new file mode 100644 index 00000000..02c2fef5 --- /dev/null +++ b/external/poky/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch @@ -0,0 +1,44 @@ +From 788c47ceef7f115ab7f7aa17f918e58795f4e6c7 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 20 Dec 2019 13:06:05 +0100 +Subject: [PATCH] Add more musl exclusions + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +[ pvorel: rebase for 20200120: enable fanotify13, fanotify15, setxattr03 ] +Signed-off-by: Petr Vorel <petr.vorel@gmail.com> +--- + testcases/kernel/syscalls/accept4/Makefile | 4 ++++ + testcases/kernel/syscalls/timer_create/Makefile | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile +index 504042e11..94db06266 100644 +--- a/testcases/kernel/syscalls/accept4/Makefile ++++ b/testcases/kernel/syscalls/accept4/Makefile +@@ -20,4 +20,8 @@ top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/testcases.mk + ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := accept4_01 ++endif ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk +diff --git a/testcases/kernel/syscalls/timer_create/Makefile b/testcases/kernel/syscalls/timer_create/Makefile +index 8de247075..eb240f432 100644 +--- a/testcases/kernel/syscalls/timer_create/Makefile ++++ b/testcases/kernel/syscalls/timer_create/Makefile +@@ -20,6 +20,10 @@ top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/testcases.mk + ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := timer_create01 timer_create03 ++endif ++ + CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include + + LDLIBS += -lpthread -lrt +-- +2.25.1 diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch new file mode 100644 index 00000000..b1a99959 --- /dev/null +++ b/external/poky/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch @@ -0,0 +1,102 @@ +From be453d1be826b862d47e08663fd69eea9dd62730 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 18:19:03 +0000 +Subject: [PATCH 1/6] build: Add option to select libc implementation + +There are more than glibc for C library implementation available on +linux now a days, uclibc cloaked like glibc but musl e.g. is very +different and does not implement all GNU extentions + +Disable tests specifically not building _yet_ on musl based systems + +Upstream-Status: Pending + +rt_tgsigqueueinfo fails with: +rt_tgsigqueueinfo01.c: In function 'sigusr1_handler': +rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'? + 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr; + | ^~~~~~~~~ + | __si_fields + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +[ pvorel: rebase for 20200120: enable mallopt, profil, rpc016, +rt_sigsuspend, sbrk_mutex, setdomainname, sethostname, sigsuspend, +testpi-3, testpi-5, testpi-6, ustat; move rt_tgsigqueueinfo +from 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch ] +Signed-off-by: Petr Vorel <petr.vorel@gmail.com> +Signed-off-by: Petr Vorel <pvorel@suse.cz> +--- + Makefile | 5 +++++ + testcases/kernel/Makefile | 5 ++++- + testcases/kernel/sched/Makefile | 4 +++- + testcases/kernel/syscalls/Makefile | 4 ++++ + 4 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 768ca4606..e9d679a71 100644 +--- a/Makefile ++++ b/Makefile +@@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include + UCLINUX ?= 0 + export UCLINUX + ++# System C library implementation (glibc,uclibc,musl etc.) ++# default to glibc if not set ++LIBC ?= glibc ++export LIBC ++ + # CLEAN_TARGETS: Targets which exist solely in clean. + # COMMON_TARGETS: Targets which exist in all, clean, and install. + # INSTALL_TARGETS: Targets which exist in clean and install (contains +diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile +index 3319b3163..94ea362c8 100644 +--- a/testcases/kernel/Makefile ++++ b/testcases/kernel/Makefile +@@ -49,13 +49,16 @@ SUBDIRS += connectors \ + logging \ + mem \ + numa \ +- pty \ + sched \ + security \ + sound \ + tracing \ + uevents \ + ++ifneq ($(LIBC),musl) ++SUBDIRS += pty ++endif ++ + ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) + SUBDIRS += power_management + endif +diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile +index 6a57d79ee..74bb93370 100644 +--- a/testcases/kernel/sched/Makefile ++++ b/testcases/kernel/sched/Makefile +@@ -23,5 +23,7 @@ + top_srcdir ?= ../../.. + + include $(top_srcdir)/include/mk/env_pre.mk +- ++ifeq ($(LIBC),musl) ++ FILTER_OUT_DIRS += process_stress ++endif + include $(top_srcdir)/include/mk/generic_trunk_target.mk +diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile +index 45a00cf7d..af5a591a0 100644 +--- a/testcases/kernel/syscalls/Makefile ++++ b/testcases/kernel/syscalls/Makefile +@@ -29,6 +29,10 @@ FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ + mincore mprotect nftw profil remap_file_pages sbrk + endif + ++ifeq ($(LIBC),musl) ++FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl rt_tgsigqueueinfo ++endif ++ + ifeq ($(UCLIBC),1) + FILTER_OUT_DIRS += profil + endif +-- +2.25.1 diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch deleted file mode 100644 index 18eba27c..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0001-mmap15-mips64-return-EINVAL.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b909805b4fc1b72e0ce299afb4abc02720ee81da Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 12 Sep 2018 14:24:35 +0800 -Subject: [PATCH] mmap15: mips64 return EINVAL - -In mips64 kernel, system check the addr that passed to mmap: - - if (TASK_SIZE - len < addr) - return -EINVAL; - -Link: https://github.com/torvalds/linux/blob/master/arch/mips/mm/mmap.c#L71 - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/394] - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - testcases/kernel/syscalls/mmap/mmap15.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/testcases/kernel/syscalls/mmap/mmap15.c b/testcases/kernel/syscalls/mmap/mmap15.c -index eff27d6..a10b5c7 100644 ---- a/testcases/kernel/syscalls/mmap/mmap15.c -+++ b/testcases/kernel/syscalls/mmap/mmap15.c -@@ -81,9 +81,14 @@ int main(int ac, char **av) - } - - if (errno != ENOMEM) { -+#ifdef __mips__ -+ tst_resm(TPASS | TERRNO, "mmap into high region " -+ "failed as expected"); -+#else - tst_resm(TFAIL | TERRNO, "mmap into high region " - "failed unexpectedly - expect " - "errno=ENOMEM, got"); -+#endif - } else { - tst_resm(TPASS | TERRNO, "mmap into high region " - "failed as expected"); --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-netns_helper.sh-use-ping-6-when-ping6-is-not-avaliab.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-netns_helper.sh-use-ping-6-when-ping6-is-not-avaliab.patch deleted file mode 100644 index 32e7a0eb..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0001-netns_helper.sh-use-ping-6-when-ping6-is-not-avaliab.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 76d8343ad300f6507233abcdf97629290e35848a Mon Sep 17 00:00:00 2001 -From: Lei Yang <Lei.Yang@windriver.com> -Date: Wed, 29 Aug 2018 11:51:24 +0800 -Subject: [PATCH] netns_helper.sh: use 'ping -6' when ping6 is not avaliable - -ping6 has been merged into ping since 2015 by using "ping -6" -in some distributions (e.g. OpenEmbedded) they dropped ping6 completely -this patch will let both "ping -6" and ping6 work. - -[pvorel: change was done in s20150815: -ebad35f ("ping: merge `ping6` command into `ping`"), -before that release switch '-6' didn't exist. -Upstream leaves ping6 symlink to distributions.] - -Upstream-Status: Backport -[https://github.com/linux-test-project/ltp/commit/76d8343ad300f6507233abcdf97629290e35848a] - -Signed-off-by: Lei Yang <Lei.Yang@windriver.com> -Signed-off-by: Petr Vorel <pvorel@suse.cz> -Signed-off-by: Yi Zhao <yi.zhao@windriver.com> ---- - testcases/kernel/containers/netns/netns_helper.sh | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/containers/netns/netns_helper.sh b/testcases/kernel/containers/netns/netns_helper.sh -index 6aea10b..a9d0459 100755 ---- a/testcases/kernel/containers/netns/netns_helper.sh -+++ b/testcases/kernel/containers/netns/netns_helper.sh -@@ -168,7 +168,12 @@ netns_setup() - ipv6) - IFCONF_IN6_ARG="inet6 add" - IP0=$6; IP1=$7; -- tping="ping6"; NETMASK=64 -+ if which ping6 >/dev/null 2>&1; then -+ tping="ping6" -+ else -+ tping="ping -6" -+ fi -+ NETMASK=64 - ;; - *) - tst_brkm TBROK "second argument must be an ip version (ipv4|ipv6)" --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch deleted file mode 100644 index 4d771c0b..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 85c972f730e8efe891a06ea3a2dfb5cbbdfbfbf4 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" <hongzhi.song@windriver.com> -Date: Wed, 10 Oct 2018 22:07:05 -0400 -Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit - -Mips will return EINVAL instead of ENOMEM as expected -if the range [addr + len) exceeds TASK_SIZE. - -Linux kernel code: arch/mips/mm/mmap.c -if (flags & MAP_FIXED) { - /* Even MAP_FIXED mappings must reside within TASK_SIZE */ - if (TASK_SIZE - len < addr) - return -EINVAL; - -Relax the condition and accept both ENOMEM and EINVAL -as expected outcome. - -Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-October/009624.html] - -Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> ---- - .../open_posix_testsuite/conformance/interfaces/mmap/24-2.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -index de51d43..810e5c8 100644 ---- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -@@ -7,7 +7,7 @@ - * source tree. - * - * The mmap() function shall fail if: -- * [ENOMEM] MAP_FIXED was specified, -+ * [ENOMEM or EINVAL] MAP_FIXED was specified, - * and the range [addr,addr+len) exceeds that allowed - * for the address space of a process; or, if MAP_FIXED was not specified and - * there is insufficient room in the address space to effect the mapping. -@@ -15,7 +15,7 @@ - * Test Step: - * 1. Map a shared memory object, with size exceeding the value get from - * rlim_cur of resource RLIMIT_AS, setting MAP_FIXED; -- * 3. Should get ENOMEM. -+ * 3. Should get ENOMEM or EINVAL. - */ - - #define _XOPEN_SOURCE 600 -@@ -93,8 +93,8 @@ int main(void) - (unsigned long)len); - pa = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, - 0); -- if (pa == MAP_FAILED && errno == ENOMEM) { -- printf("Got ENOMEM: %s\nTest PASSED\n", strerror(errno)); -+ if (pa == MAP_FAILED && (errno == ENOMEM || errno == EINVAL)) { -+ printf("Got ENOMEM or EINVAL: %s\nTest PASSED\n", strerror(errno)); - exit(PTS_PASS); - } - -@@ -103,6 +103,6 @@ int main(void) - else - munmap(pa, len); - close(fd); -- printf("Test Fail: Did not get ENOMEM as expected\n"); -+ printf("Test Failed: Did not get ENOMEM or EINVAL as expected\n"); - return PTS_FAIL; - } --- -2.8.1 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch deleted file mode 100644 index c412c89e..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch +++ /dev/null @@ -1,75 +0,0 @@ -From bb977ca0716ae98f10102c7122fe15bc0ddb5356 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" <hongzhi.song@windriver.com> -Date: Thu, 20 Sep 2018 21:49:02 -0400 -Subject: [PATCH] sigwaitinfo01: recent glibc calls syscall directly - -glibc commit - 8b0e795aaa44 ("Simplify Linux sig{timed}wait{info} implementations") -changed sigwaitinfo to call sigtimedwait, which calls rt_sigtimedwait -syscall directly. - -So, an invalid pointer no longer crashes child process and test -reports failure. Fix it by accepting either crash or EFAULT. - -Signed-off-by: Jan Stancek <jstancek@redhat.com> - -Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-September/009338.html] - -Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> ---- - .../kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 30 +++++++++++++++++++--- - 1 file changed, 26 insertions(+), 4 deletions(-) - -diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c -index 95a9436a4..8fa8ac34b 100644 ---- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c -+++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c -@@ -371,19 +371,41 @@ void test_bad_address2(swi_func sigwaitinfo, int signo) - tst_brkm(TBROK | TERRNO, NULL, "fork() failed"); - case 0: - signal(SIGSEGV, SIG_DFL); -+ -+ /* -+ * depending on glibc implementation we should -+ * either crash or get EFAULT -+ */ - TEST(sigwaitinfo((void *)1, NULL, NULL)); - -- _exit(0); -+ if (TEST_RETURN == -1 && TEST_ERRNO == EFAULT) -+ _exit(0); -+ -+ tst_resm(TINFO, "swi_func returned: %ld, errno: %d", -+ TEST_RETURN, TEST_ERRNO); -+ _exit(1); -+ - break; - default: - break; - } - - SUCCEED_OR_DIE(waitpid, "waitpid failed", pid, &status, 0); -- if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) -+ -+ if ((WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) -+ || (WIFEXITED(status) && WEXITSTATUS(status) == 0)) { - tst_resm(TPASS, "Test passed"); -- else -- tst_resm(TFAIL, "Unrecognised child exit code"); -+ return; -+ } -+ -+ if (WIFEXITED(status)) { -+ tst_resm(TFAIL, "Unrecognised child exit code: %d", -+ WEXITSTATUS(status)); -+ } -+ if (WIFSIGNALED(status)) { -+ tst_resm(TFAIL, "Unrecognised child termsig: %d", -+ WTERMSIG(status)); -+ } - } - - void test_bad_address3(swi_func sigwaitinfo, int signo) --- -2.11.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch new file mode 100644 index 00000000..ac8f08ef --- /dev/null +++ b/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch @@ -0,0 +1,122 @@ +From 89c5841bd148a7ae70c65f4a1ca5996b7f0cddfa Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 19 Feb 2020 22:52:04 -0800 +Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them + +musl is using 64bit time_t now on 32bit architectures and these syscalls +no longer exist, therefore its better to check for them being available +before using them + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com> +Reviewed-by: Petr Vorel <pvorel@suse.cz> +Signed-off-by: Petr Vorel <pvorel@suse.cz> +Upstream-Status: accepted as 5b57ae2913e2d2d167cbd3822784b4c4ba336812 +--- + lib/tst_clocks.c | 16 ++++++---------- + .../syscalls/gettimeofday/gettimeofday01.c | 6 ++---- + .../syscalls/gettimeofday/gettimeofday02.c | 8 +++----- + 3 files changed, 11 insertions(+), 19 deletions(-) + +diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c +index 5195da38f..fa2f1cb84 100644 +--- a/lib/tst_clocks.c ++++ b/lib/tst_clocks.c +@@ -3,28 +3,24 @@ + * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> + */ + +-/* +- * clock_gettime() and clock_getres() functions +- */ +- +-#define _GNU_SOURCE +-#include <unistd.h> + #include <time.h> +-#include <sys/syscall.h> + ++#define TST_NO_DEFAULT_MAIN ++#include "tst_test.h" + #include "tst_clocks.h" ++#include "lapi/syscalls.h" + + int tst_clock_getres(clockid_t clk_id, struct timespec *res) + { +- return syscall(SYS_clock_getres, clk_id, res); ++ return tst_syscall(__NR_clock_getres, clk_id, res); + } + + int tst_clock_gettime(clockid_t clk_id, struct timespec *ts) + { +- return syscall(SYS_clock_gettime, clk_id, ts); ++ return tst_syscall(__NR_clock_gettime, clk_id, ts); + } + + int tst_clock_settime(clockid_t clk_id, struct timespec *ts) + { +- return syscall(SYS_clock_settime, clk_id, ts); ++ return tst_syscall(__NR_clock_settime, clk_id, ts); + } +diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c +index 583d8f7b9..08ea1673a 100644 +--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c ++++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c +@@ -38,10 +38,8 @@ + #include <sys/time.h> + #include <errno.h> + #include "test.h" +-#include <sys/syscall.h> + #include <unistd.h> +- +-#define gettimeofday(a,b) syscall(__NR_gettimeofday,a,b) ++#include "lapi/syscalls.h" + + char *TCID = "gettimeofday01"; + int TST_TOTAL = 1; +@@ -63,7 +61,7 @@ int main(int ac, char **av) + for (lc = 0; TEST_LOOPING(lc); lc++) { + tst_count = 0; + +- TEST(gettimeofday((void *)-1, (void *)-1)); ++ TEST(ltp_syscall(__NR_gettimeofday, (void *)-1, (void *)-1)); + + /* gettimeofday returns an int, so we need to turn the long + * TEST_RETURN into an int to test with */ +diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c +index 1d60f448e..5170ad2f7 100644 +--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c ++++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c +@@ -16,14 +16,12 @@ + #include <stdint.h> + #include <sys/time.h> + #include <stdlib.h> +-#include <sys/syscall.h> + #include <unistd.h> + #include <time.h> + #include <errno.h> + + #include "tst_test.h" +- +-#define gettimeofday(a,b) syscall(__NR_gettimeofday,a,b) ++#include "lapi/syscalls.h" + + static volatile sig_atomic_t done; + static char *str_rtime; +@@ -48,13 +46,13 @@ static void verify_gettimeofday(void) + + alarm(rtime); + +- if (gettimeofday(&tv1, NULL)) { ++ if (tst_syscall(__NR_gettimeofday, &tv1, NULL)) { + tst_res(TBROK | TERRNO, "gettimeofday() failed"); + return; + } + + while (!done) { +- if (gettimeofday(&tv2, NULL)) { ++ if (tst_syscall(__NR_gettimeofday, &tv2, NULL)) { + tst_res(TBROK | TERRNO, "gettimeofday() failed"); + return; + } +-- +2.25.1 diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch b/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch deleted file mode 100644 index 2755596d..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch +++ /dev/null @@ -1,184 +0,0 @@ -From 8de03ea1200480b922d5ba05b69dc94db60496f5 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" <hongzhi.song@windriver.com> -Date: Sat, 15 Sep 2018 22:39:32 -0400 -Subject: [PATCH] syscalls/fcntl: make OFD command use fcntl64() syscall on - 32-bit - -To cope with glibc commit: - 06ab719d30b0 ("Fix Linux fcntl OFD locks for non-LFS architectures -(BZ#20251)") - -WIP: Still need to test this with new glibc. - Test with old glibc look OK so far. - -Signed-off-by: Jan Stancek <jstancek@redhat.com> - -Upstream-Status: Backport - Backported from upstream maillist - https://lists.linux.it/pipermail/ltp/2018-September/009370.html - -Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com> ---- - testcases/kernel/syscalls/fcntl/fcntl34.c | 12 +++++++--- - testcases/kernel/syscalls/fcntl/fcntl36.c | 23 +++++++++++++----- - testcases/kernel/syscalls/fcntl/fcntl_common.h | 32 ++++++++++++++++++++++++++ - 3 files changed, 58 insertions(+), 9 deletions(-) - create mode 100644 testcases/kernel/syscalls/fcntl/fcntl_common.h - -diff --git a/testcases/kernel/syscalls/fcntl/fcntl34.c b/testcases/kernel/syscalls/fcntl/fcntl34.c -index aa29cf9..109f834 100644 ---- a/testcases/kernel/syscalls/fcntl/fcntl34.c -+++ b/testcases/kernel/syscalls/fcntl/fcntl34.c -@@ -28,6 +28,7 @@ - #include "lapi/fcntl.h" - #include "tst_safe_pthread.h" - #include "tst_test.h" -+#include "fcntl_common.h" - - static int thread_cnt; - static const int max_thread_cnt = 32; -@@ -68,7 +69,12 @@ void *thread_fn_01(void *arg) - - memset(buf, (intptr_t)arg, write_size); - -- struct flock64 lck = { -+ /* see explanation in fcntl_common.h */ -+ #ifdef USE_STRUCT_FLOCK -+ struct flock lck = { -+ #else -+ struct flock64 lck = { -+ #endif - .l_whence = SEEK_SET, - .l_start = 0, - .l_len = 1, -@@ -76,13 +82,13 @@ void *thread_fn_01(void *arg) - - for (i = 0; i < writes_num; ++i) { - lck.l_type = F_WRLCK; -- SAFE_FCNTL(fd, F_OFD_SETLKW, &lck); -+ my_fcntl(fd, F_OFD_SETLKW, &lck); - - SAFE_LSEEK(fd, 0, SEEK_END); - SAFE_WRITE(1, fd, buf, write_size); - - lck.l_type = F_UNLCK; -- SAFE_FCNTL(fd, F_OFD_SETLKW, &lck); -+ my_fcntl(fd, F_OFD_SETLKW, &lck); - - sched_yield(); - } -diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c -index 3246d13..f263b6b 100644 ---- a/testcases/kernel/syscalls/fcntl/fcntl36.c -+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c -@@ -57,6 +57,7 @@ - #include "lapi/fcntl.h" - #include "tst_safe_pthread.h" - #include "tst_test.h" -+#include "fcntl_common.h" - - static int thread_cnt; - static int fail_flag = 0; -@@ -87,7 +88,12 @@ static void *fn_ofd_w(void *arg) - int fd = SAFE_OPEN(fname, O_RDWR); - long wt = pa->cnt; - -- struct flock64 lck = { -+ /* see explanation in fcntl_common.h */ -+ #ifdef USE_STRUCT_FLOCK -+ struct flock lck = { -+ #else -+ struct flock64 lck = { -+ #endif - .l_whence = SEEK_SET, - .l_start = pa->offset, - .l_len = pa->length, -@@ -99,13 +105,13 @@ static void *fn_ofd_w(void *arg) - memset(buf, wt, pa->length); - - lck.l_type = F_WRLCK; -- SAFE_FCNTL(fd, F_OFD_SETLKW, &lck); -+ my_fcntl(fd, F_OFD_SETLKW, &lck); - - SAFE_LSEEK(fd, pa->offset, SEEK_SET); - SAFE_WRITE(1, fd, buf, pa->length); - - lck.l_type = F_UNLCK; -- SAFE_FCNTL(fd, F_OFD_SETLKW, &lck); -+ my_fcntl(fd, F_OFD_SETLKW, &lck); - - wt++; - if (wt >= 255) -@@ -166,7 +172,12 @@ static void *fn_ofd_r(void *arg) - int i; - int fd = SAFE_OPEN(fname, O_RDWR); - -- struct flock64 lck = { -+ /* see explanation in fcntl_common.h */ -+ #ifdef USE_STRUCT_FLOCK -+ struct flock lck = { -+ #else -+ struct flock64 lck = { -+ #endif - .l_whence = SEEK_SET, - .l_start = pa->offset, - .l_len = pa->length, -@@ -178,7 +189,7 @@ static void *fn_ofd_r(void *arg) - memset(buf, 0, pa->length); - - lck.l_type = F_RDLCK; -- SAFE_FCNTL(fd, F_OFD_SETLKW, &lck); -+ my_fcntl(fd, F_OFD_SETLKW, &lck); - - /* rlock acquired */ - SAFE_LSEEK(fd, pa->offset, SEEK_SET); -@@ -209,7 +220,7 @@ static void *fn_ofd_r(void *arg) - } - - lck.l_type = F_UNLCK; -- SAFE_FCNTL(fd, F_OFD_SETLK, &lck); -+ my_fcntl(fd, F_OFD_SETLK, &lck); - - sched_yield(); - } -diff --git a/testcases/kernel/syscalls/fcntl/fcntl_common.h b/testcases/kernel/syscalls/fcntl/fcntl_common.h -new file mode 100644 -index 0000000..3fe399b ---- /dev/null -+++ b/testcases/kernel/syscalls/fcntl/fcntl_common.h -@@ -0,0 +1,32 @@ -+#include "lapi/syscalls.h" -+ -+/* -+ * glibc commit: -+ * 06ab719d30b0 ("Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)") -+ * changed behavior of arg parameter for OFD commands. It is no -+ * longer passing arg directly to syscall, but expects it to be -+ * 'struct flock'. -+ * -+ * On 64-bit or _FILE_OFFSET_BITS == 64 we can use fcntl() and -+ * struct flock with any glibc version. struct flock and flock64 -+ * should be identical. -+ * -+ * On 32-bit, older glibc would pass arg directly, recent one treats -+ * it as 'struct flock' and converts it to 'struct flock64'. -+ * So, for 32-bit we use fcntl64 syscall directly with struct flock64. -+ */ -+#if __WORDSIZE == 64 || _FILE_OFFSET_BITS == 64 -+#define USE_STRUCT_FLOCK -+static int my_fcntl(int fd, int cmd, void *lck) -+{ -+ return SAFE_FCNTL(fd, cmd, lck); -+} -+#else -+static int my_fcntl(int fd, int cmd, void *lck) -+{ -+ int ret = tst_syscall(__NR_fcntl64, fd, cmd, lck); -+ if (ret == -1) -+ tst_brk(TBROK|TERRNO, "fcntl64"); -+ return ret; -+} -+#endif --- -2.8.1 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/external/poky/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch new file mode 100644 index 00000000..df3e8831 --- /dev/null +++ b/external/poky/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch @@ -0,0 +1,55 @@ +From 1ce47a6ed811fd78ed04ea2f82e6321c6bca57b6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 19:40:08 +0000 +Subject: [PATCH] Check if __GLIBC_PREREQ is defined before using it + +__GLIBC_PREREQ is specific to glibc so it should be checked if it is +defined or not. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> + +--- + testcases/kernel/syscalls/accept4/accept4_01.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c +index 29e18f27d..07444a46f 100644 +--- a/testcases/kernel/syscalls/accept4/accept4_01.c ++++ b/testcases/kernel/syscalls/accept4/accept4_01.c +@@ -38,6 +38,7 @@ + static struct sockaddr_in *conn_addr, *accept_addr; + static int listening_fd; + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + static int + accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) +@@ -56,6 +57,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + #endif + } + #endif ++#endif + + static int create_listening_socket(void) + { +@@ -114,12 +116,17 @@ static void verify_accept4(unsigned int nr) + SAFE_CONNECT(connfd, (struct sockaddr *)conn_addr, sizeof(*conn_addr)); + addrlen = sizeof(*accept_addr); + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + TEST(accept4_01(listening_fd, (struct sockaddr *)accept_addr, &addrlen, + tcase->cloexec | tcase->nonblock)); + #else + TEST(accept4(listening_fd, (struct sockaddr *)accept_addr, &addrlen, + tcase->cloexec | tcase->nonblock)); ++#endif ++#else ++ TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, ++ tcase->cloexec | tcase->nonblock)); + #endif + if (TST_RET == -1) { + if (TST_ERR == ENOSYS) diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/external/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch deleted file mode 100644 index 2df38559..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 18:19:03 +0000 -Subject: [PATCH 04/32] build: Add option to select libc implementation - -There are more than glibc for C library implementation available on -linux now a days, uclibc cloaked like glibc but musl e.g. is very -different and does not implement all GNU extentions - -Disable tests specifically not building _yet_ on musl based systems - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - Makefile | 5 +++++ - testcases/kernel/Makefile | 5 ++++- - testcases/kernel/sched/Makefile | 4 +++- - testcases/kernel/syscalls/Makefile | 5 +++++ - testcases/network/nfsv4/acl/Makefile | 4 ++++ - testcases/network/rpc/basic_tests/Makefile | 5 +++++ - testcases/realtime/func/pi-tests/Makefile | 4 ++++ - testcases/realtime/stress/pi-tests/Makefile | 5 +++++ - 8 files changed, 35 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 297f8e7..906b280 100644 ---- a/Makefile -+++ b/Makefile -@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0 - UCLINUX ?= 0 - export UCLINUX - -+# System C library implementation (glibc,uclibc,musl etc.) -+# default to glibc if not set -+LIBC ?= glibc -+export LIBC -+ - # CLEAN_TARGETS: Targets which exist solely in clean. - # COMMON_TARGETS: Targets which exist in all, clean, and install. - # INSTALL_TARGETS: Targets which exist in clean and install (contains -diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile -index 50a12fa..4f1987f 100644 ---- a/testcases/kernel/Makefile -+++ b/testcases/kernel/Makefile -@@ -48,13 +48,16 @@ SUBDIRS += connectors \ - logging \ - mem \ - numa \ -- pty \ - sched \ - security \ - timers \ - tracing \ - module \ - -+ifneq ($(LIBC),musl) -+SUBDIRS += pty -+endif -+ - ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) - SUBDIRS += power_management - endif -diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile -index 6245ed0..aa4eb7f 100644 ---- a/testcases/kernel/sched/Makefile -+++ b/testcases/kernel/sched/Makefile -@@ -23,5 +23,7 @@ - top_srcdir ?= ../../.. - - include $(top_srcdir)/include/mk/env_pre.mk -- -+ifeq ($(LIBC),musl) -+ FILTER_OUT_DIRS += process_stress -+endif - include $(top_srcdir)/include/mk/generic_trunk_target.mk -diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile -index 8acb395..b749126 100644 ---- a/testcases/kernel/syscalls/Makefile -+++ b/testcases/kernel/syscalls/Makefile -@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) - FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ - mincore mprotect nftw profil remap_file_pages sbrk - endif -+ifeq ($(LIBC),musl) -+FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \ -+ rt_sigsuspend setdomainname sethostname sigsuspend \ -+ ustat -+endif - - ifeq ($(UCLIBC),1) - FILTER_OUT_DIRS += profil -diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile -index 8bc78c2..c36cf50 100644 ---- a/testcases/network/nfsv4/acl/Makefile -+++ b/testcases/network/nfsv4/acl/Makefile -@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk - - LDLIBS += $(ACL_LIBS) - -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := acl1 -+endif -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk -diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile -index 3160813..9bdf5d0 100644 ---- a/testcases/network/rpc/basic_tests/Makefile -+++ b/testcases/network/rpc/basic_tests/Makefile -@@ -23,4 +23,9 @@ - top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/env_pre.mk -+ -+ifeq ($(LIBC),musl) -+FILTER_OUT_DIRS += rpc01 -+endif -+ - include $(top_srcdir)/include/mk/generic_trunk_target.mk -diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile -index 7a7a57a..5808866 100644 ---- a/testcases/realtime/func/pi-tests/Makefile -+++ b/testcases/realtime/func/pi-tests/Makefile -@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk - include $(abs_srcdir)/../../config.mk - - MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex -+endif -+ - - include $(top_srcdir)/include/mk/generic_leaf_target.mk -diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile -index 5edc3b4..aa5987a 100644 ---- a/testcases/realtime/stress/pi-tests/Makefile -+++ b/testcases/realtime/stress/pi-tests/Makefile -@@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/env_pre.mk - include $(abs_srcdir)/../../config.mk -+ -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := testpi-3 -+endif -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/external/poky/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch index a79763d0..5622a64d 100644 --- a/external/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch +++ b/external/poky/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch @@ -1,12 +1,13 @@ -From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001 +From d0fc9ca5d3366f9b8907e463222403cd2327be10 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 8 Jan 2016 06:51:20 +0000 -Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__ +Subject: [PATCH] guard mallocopt() with __GLIBC__ mallocopt is not available on non glibc implementations -Signed-off-by: Khem Raj <raj.khem@gmail.com> Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> --- utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) @@ -29,5 +30,5 @@ index 5bb8eff..934d951 100644 fprintf(stderr, "Chunk size %u smaller than record size %u\n", chunk_size, record_size); -- -2.7.0 +2.7.4 diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/external/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch deleted file mode 100644 index b9390e2c..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 18:22:38 +0000 -Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl - -musl does not implement fts like glibc and therefore it depends on -external implementation for all fts APIs - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - testcases/kernel/controllers/Makefile.inc | 3 +++ - testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc -index b106283..ef5fc0c 100644 ---- a/testcases/kernel/controllers/Makefile.inc -+++ b/testcases/kernel/controllers/Makefile.inc -@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB) - CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR) - - LDFLAGS += -L$(abs_builddir)/../$(LIBDIR) -+ifeq ($(LIBC),musl) -+LDLIBS += -lfts -+endif - - INSTALL_TARGETS ?= *.sh - -diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc -index 9e002f4..e0fcb9c 100644 ---- a/testcases/kernel/controllers/cpuset/Makefile.inc -+++ b/testcases/kernel/controllers/cpuset/Makefile.inc -@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET) - LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR) - - LDLIBS += -lcpu_set -lcontrollers -lltp -+ifeq ($(LIBC),musl) -+LDLIBS += -lfts -+endif - - INSTALL_TARGETS ?= *.sh - --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/external/poky/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch index 71e32a5e..0e726457 100644 --- a/external/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch +++ b/external/poky/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch @@ -1,25 +1,25 @@ -From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001 +From f4fafbdffae3a63c81f65cef98c72dda26283e06 Mon Sep 17 00:00:00 2001 From: Dengke Du <dengke.du@windriver.com> Date: Wed, 8 Feb 2017 16:17:17 +0800 -Subject: [PATCH 3/5] Fix test_proc_kill hanging +Subject: [PATCH] Fix test_proc_kill hanging Sometimes the signal is delivered to memcg_process before the framework took into consideration its pid entered in the tasks. Fixed by delaying the signal send command. +Upstream-Status: Pending + Signed-off-by: George Nita <george.nita@enea.com> Signed-off-by: Dengke Du <dengke.du@windriver.com> - -Upstream-Status: Pending --- testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh -index b785fe3..2918cc5 100755 +index aadaae4..deea5d6 100755 --- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh +++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh -@@ -283,6 +283,7 @@ test_proc_kill() +@@ -291,6 +291,7 @@ test_proc_kill() pid=$! TST_CHECKPOINT_WAIT 0 echo $pid > tasks diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/external/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch deleted file mode 100644 index 2f4ca637..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d1a27570457fb6e1d6bafe81bfa0f3507b137e32 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Thu, 9 Feb 2017 18:20:58 +0800 -Subject: [PATCH] fix __WORDSIZE undeclared when building with musl - -fix __WORDSIZE undeclared when building with musl. - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - include/old/test.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/include/old/test.h b/include/old/test.h -index b36764d83..cc6f1b551 100644 ---- a/include/old/test.h -+++ b/include/old/test.h -@@ -44,6 +44,9 @@ - #include <string.h> - #include <stdlib.h> - #include <stdint.h> -+#ifndef __GLIBC__ -+#include <bits/reg.h> -+#endif - - #include "usctest.h" - --- -2.11.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/external/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch deleted file mode 100644 index 428ac300..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +++ /dev/null @@ -1,283 +0,0 @@ -From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 19:40:08 +0000 -Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it - -__GLIBC_PREREQ is specific to glibc so it should be checked if it is -defined or not. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++- - testcases/kernel/syscalls/getcpu/getcpu01.c | 39 +++++++++++++++++++++- - .../sched_getaffinity/sched_getaffinity01.c | 26 +++++++++++++++ - 3 files changed, 72 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c -index 6072bfa..2b090cb 100644 ---- a/testcases/kernel/syscalls/accept4/accept4_01.c -+++ b/testcases/kernel/syscalls/accept4/accept4_01.c -@@ -64,6 +64,7 @@ static void cleanup(void) - tst_rmdir(); - } - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 10)) - static int - accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) -@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) - } - tst_resm(TINFO, "\n"); - #endif -- - #if USE_SOCKETCALL - long args[6]; - -@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) - #endif - } - #endif -+#endif - - static void - do_test(int lfd, struct sockaddr_in *conn_addr, -@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr, - die("Connect Error"); - - addrlen = sizeof(struct sockaddr_in); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 10)) - acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, - closeonexec_flag | nonblock_flag); -+ -+#else -+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, -+ closeonexec_flag | nonblock_flag); -+#endif - #else - acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, - closeonexec_flag | nonblock_flag); -diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c -index c927512..921b107 100644 ---- a/testcases/kernel/syscalls/getcpu/getcpu01.c -+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c -@@ -62,6 +62,7 @@ - #include <dirent.h> - - #if defined(__i386__) || defined(__x86_64__) -+#if defined(__GLIBC__) - #if __GLIBC_PREREQ(2,6) - #if defined(__x86_64__) - #include <utmpx.h> -@@ -75,10 +76,17 @@ int sys_support = 0; - #else - int sys_support = 0; - #endif -+#else -+int sys_support = 0; -+#endif - -+#if defined(__GLIBC__) - #if !(__GLIBC_PREREQ(2, 7)) - #define CPU_FREE(ptr) free(ptr) - #endif -+#else -+#define CPU_FREE(ptr) free(ptr) -+#endif - - void cleanup(void); - void setup(void); -@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id, - { - #if defined(__i386__) - return syscall(318, cpu_id, node_id, cache_struct); --#elif __GLIBC_PREREQ(2,6) -+#elif defined(__GLIBC__) -+#if __GLIBC_PREREQ(2,6) -+ *cpu_id = sched_getcpu(); -+#endif -+#else - *cpu_id = sched_getcpu(); - #endif - return 0; -@@ -191,15 +203,20 @@ unsigned int set_cpu_affinity(void) - cpu_set_t *set; - size_t size; - int nrcpus = 1024; -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - realloc: - set = CPU_ALLOC(nrcpus); - #else - set = malloc(sizeof(cpu_set_t)); - #endif -+#else -+ set = malloc(sizeof(cpu_set_t)); -+#endif - if (set == NULL) { - tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno); - } -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - size = CPU_ALLOC_SIZE(nrcpus); - CPU_ZERO_S(size, set); -@@ -207,8 +224,13 @@ realloc: - size = sizeof(cpu_set_t); - CPU_ZERO(set); - #endif -+#else -+ size = sizeof(cpu_set_t); -+ CPU_ZERO(set); -+#endif - if (sched_getaffinity(0, size, set) < 0) { - CPU_FREE(set); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (errno == EINVAL && nrcpus < (1024 << 8)) { - nrcpus = nrcpus << 2; -@@ -220,10 +242,17 @@ realloc: - "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); - else - #endif -+#else -+ if (errno == EINVAL) -+ tst_resm(TFAIL, -+ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); -+ else -+#endif - tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno); - tst_exit(); - } - cpu_max = max_cpuid(size, set); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - CPU_ZERO_S(size, set); - CPU_SET_S(cpu_max, size, set); -@@ -231,6 +260,10 @@ realloc: - CPU_ZERO(set); - CPU_SET(cpu_max, set); - #endif -+#else -+ CPU_ZERO(set); -+ CPU_SET(cpu_max, set); -+#endif - if (sched_setaffinity(0, size, set) < 0) { - CPU_FREE(set); - tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno); -@@ -247,11 +280,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set) - { - unsigned int index, max = 0; - for (index = 0; index < size * BITS_PER_BYTE; index++) -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (CPU_ISSET_S(index, size, set)) - #else - if (CPU_ISSET(index, set)) - #endif -+#else -+ if (CPU_ISSET(index, set)) -+#endif - max = index; - return max; - } -diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -index 9d6a81a..4ed13b2 100644 ---- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -@@ -67,9 +67,11 @@ do { \ - tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \ - } while (0) - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 7)) - #define CPU_FREE(ptr) free(ptr) - #endif -+#endif - - int main(int ac, char **av) - { -@@ -96,14 +98,19 @@ static void do_test(void) - pid_t unused_pid; - unsigned len; - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - realloc: - mask = CPU_ALLOC(nrcpus); - #else - mask = malloc(sizeof(cpu_set_t)); - #endif -+#else -+ mask = malloc(sizeof(cpu_set_t)); -+#endif - if (mask == NULL) - tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory"); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - len = CPU_ALLOC_SIZE(nrcpus); - CPU_ZERO_S(len, mask); -@@ -111,10 +118,15 @@ realloc: - len = sizeof(cpu_set_t); - CPU_ZERO(mask); - #endif -+#else -+ len = sizeof(cpu_set_t); -+ CPU_ZERO(mask); -+#endif - /* positive test */ - TEST(sched_getaffinity(0, len, mask)); - if (TEST_RETURN == -1) { - CPU_FREE(mask); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (errno == EINVAL && nrcpus < (1024 << 8)) { - nrcpus = nrcpus << 2; -@@ -126,17 +138,27 @@ realloc: - "newer glibc(>= 2.7)"); - else - #endif -+#else -+ if (errno == EINVAL) -+ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " -+ "newer glibc(>= 2.7)"); -+ else -+#endif - tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity"); - cleanup(); - } else { - tst_resm(TINFO, "cpusetsize is %d", len); - tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]); - for (i = 0; i < num; i++) { -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - TEST(CPU_ISSET_S(i, len, mask)); - #else - TEST(CPU_ISSET(i, mask)); - #endif -+#else -+ TEST(CPU_ISSET(i, mask)); -+#endif - if (TEST_RETURN != -1) - tst_resm(TPASS, "sched_getaffinity() succeed, " - "this process %d is running " -@@ -144,11 +166,15 @@ realloc: - } - } - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - CPU_ZERO_S(len, mask); - #else - CPU_ZERO(mask); - #endif -+#else -+ CPU_ZERO(mask); -+#endif - /* negative tests */ - QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1)); - QUICK_TEST(sched_getaffinity(0, 0, mask)); --- -1.9.1 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/external/poky/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch index e826d48e..350091a7 100644 --- a/external/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch +++ b/external/poky/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch @@ -1,33 +1,34 @@ -From 672a56be14426eae44864673c6c2afca0ab89d46 Mon Sep 17 00:00:00 2001 +From 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> Date: Fri, 13 May 2016 11:11:28 -0500 -Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on string - printf +Subject: [PATCH] acl: Security fix on string printf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Fixes: +Fixes build error when compiled with -Werror=format-security: -acl1.c: In function 'test_acl_default': -acl1.c:317:2: error: format not a string literal and no format arguments -[-Werror=format-security] - printf(cmd); +acl1.c: In function ‘test_acl_default’: +acl1.c:305:2: error: format not a string literal and no format arguments [-Werror=format-security] + 305 | printf(cmd); + +Patch taken from openembedded-core, +original bug report: https://bugzilla.yoctoproject.org/9548 [YOCTO #9548] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> - -Upstream-Status: Pending +Signed-off-by: Petr Vorel <pvorel@suse.cz> +Upstream-Status: accepted in 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 --- testcases/network/nfsv4/acl/acl1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c -index b8b67b4..7c7c506 100644 +index aae9484e5..ad778cd33 100644 --- a/testcases/network/nfsv4/acl/acl1.c +++ b/testcases/network/nfsv4/acl/acl1.c -@@ -303,7 +303,7 @@ void test_acl_default(char *dir, acl_t acl) +@@ -302,7 +302,7 @@ void test_acl_default(char *dir, acl_t acl) char *cmd = malloc(256); strcpy(cmd, "chmod 7777 "); @@ -37,5 +38,5 @@ index b8b67b4..7c7c506 100644 system(cmd); acl2 = acl_get_file(path, ACL_TYPE_ACCESS); -- -2.1.4 +2.25.1 diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/external/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch deleted file mode 100644 index dd7d2831..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch +++ /dev/null @@ -1,36 +0,0 @@ -From bf5dd2932200e0199a38f3028d3bef2253f32e38 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Thu, 9 Feb 2017 17:17:37 +0800 -Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl - -When building with musl the file "sys/msg.h" already contain 'struct msgbuf' - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -index a757c0d18..e023114d2 100644 ---- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08"; - const int TST_TOTAL = 1; - - #if __WORDSIZE == 32 -- -+#ifdef __GLIBC__ - struct msgbuf { - long mtype; /* message type, must be > 0 */ - char mtext[16]; /* message data */ - }; -+#else -+#endif - - static void msr(int msqid) - { --- -2.11.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/external/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch deleted file mode 100644 index 7060a64b..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch +++ /dev/null @@ -1,50 +0,0 @@ -From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 06:57:04 +0000 -Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc - -getdents/getdents64 are implemented in musl and when we define static -functions with same name, it errors out. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/getdents/getdents.h | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h -index abea655..db63d89 100644 ---- a/testcases/kernel/syscalls/getdents/getdents.h -+++ b/testcases/kernel/syscalls/getdents/getdents.h -@@ -34,12 +34,13 @@ struct linux_dirent { - char d_name[]; - }; - -+#ifdef __GLIBC__ - static inline int - getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) - { - return ltp_syscall(__NR_getdents, fd, dirp, size); - } -- -+#endif - struct linux_dirent64 { - uint64_t d_ino; - int64_t d_off; -@@ -48,10 +49,11 @@ struct linux_dirent64 { - char d_name[]; - }; - -+#ifdef __GLIBC__ - static inline int - getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) - { - return ltp_syscall(__NR_getdents64, fd, dirp64, size); - } -- -+#endif - #endif /* GETDENTS_H */ --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/external/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch deleted file mode 100644 index 6c5f3603..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:01:02 +0000 -Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition - -musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses -__USE_GNU - -Fixes errors like -error: 'MREMAP_MAYMOVE' undeclared (first use in this function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/mremap/mremap01.c | 4 +++- - testcases/kernel/syscalls/mremap/mremap02.c | 2 ++ - testcases/kernel/syscalls/mremap/mremap03.c | 2 ++ - 3 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c -index d63d1e4..24ca174 100644 ---- a/testcases/kernel/syscalls/mremap/mremap01.c -+++ b/testcases/kernel/syscalls/mremap/mremap01.c -@@ -76,10 +76,12 @@ - */ - #include <unistd.h> - #include <errno.h> -+#include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU --#include <fcntl.h> -+#undef _GNU_SOURCE - - #include "test.h" - #include "safe_macros.h" -diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c -index 5a51b9a..a530a6b 100644 ---- a/testcases/kernel/syscalls/mremap/mremap02.c -+++ b/testcases/kernel/syscalls/mremap/mremap02.c -@@ -75,9 +75,11 @@ - #include <errno.h> - #include <unistd.h> - #include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU -+#undef _GNU_SOURCE - - #include "test.h" - -diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c -index 12e3829..9b39f8b 100644 ---- a/testcases/kernel/syscalls/mremap/mremap03.c -+++ b/testcases/kernel/syscalls/mremap/mremap03.c -@@ -76,9 +76,11 @@ - #include <errno.h> - #include <unistd.h> - #include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU -+#undef _GNU_SOURCE - - #include "test.h" - --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/external/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch deleted file mode 100644 index 529f4ed3..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:08:25 +0000 -Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request - -__ptrace_request is only available with glibc - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++ - testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c -index a4028fc..f1880cd 100644 ---- a/testcases/kernel/syscalls/ptrace/ptrace03.c -+++ b/testcases/kernel/syscalls/ptrace/ptrace03.c -@@ -102,7 +102,11 @@ static pid_t unused_pid; - static pid_t zero_pid; - - struct test_case_t { -+#ifdef __GLIBC__ - enum __ptrace_request request; -+#else -+ int request; -+#endif - pid_t *pid; - int exp_errno; - } test_cases[] = { -diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -index ae538e9..85aa89d 100644 ---- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -+++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -@@ -130,7 +130,11 @@ static char *strings[] = { - SPT(KILL) - SPT(SINGLESTEP) - }; -+#ifdef __GLIBC__ - static inline char *strptrace(enum __ptrace_request request) -+#else -+static inline char *strptrace(int request) -+#endif - { - return strings[request]; - } --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/external/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch deleted file mode 100644 index 03aa45df..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch +++ /dev/null @@ -1,70 +0,0 @@ -From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:14:58 +0000 -Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE - -Fixes musl build failure e.g. -error: 'SA_NOMASK' undeclared here (not in a function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 + - testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- - testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 + - testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 + - 4 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -index 5cf89cc..bdcb91a 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -@@ -28,6 +28,7 @@ - /* sigset_t type. */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -index a1da743..8a27a0f 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -@@ -23,7 +23,7 @@ - /* Description: This tests the rt_sigaction() syscall */ - /* rt_sigaction Expected EFAULT error check */ - /******************************************************************************/ -- -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -index 175d220..e7627cd 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -@@ -24,6 +24,7 @@ - /* rt_sigaction Expected EINVAL error check */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -index 74e5a61..75c57fc 100644 ---- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -@@ -39,6 +39,7 @@ - /* sigsetsize should indicate the size of a sigset_t type. */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <signal.h> - #include <errno.h> --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/external/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch deleted file mode 100644 index f65fad12..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:21:05 +0000 -Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE - -Fixes musl build errors like -error: 'SA_NOMASK' undeclared (first use in this function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/misc/crash/crash01.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c -index 0574521..08a02e7 100644 ---- a/testcases/misc/crash/crash01.c -+++ b/testcases/misc/crash/crash01.c -@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user - benchmark. - - */ -- -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <string.h> --- -2.7.0 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/external/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch deleted file mode 100644 index 40ee8941..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:24:44 +0000 -Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of - __sighandler_t - -When _GNU_SOURCE is used then both typedefs are same and using -sighandler_t makes it work on musl too - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - include/lapi/rt_sigaction.h | 4 ++-- - testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++ - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h -index 18236db..15facda 100644 ---- a/include/lapi/rt_sigaction.h -+++ b/include/lapi/rt_sigaction.h -@@ -36,12 +36,12 @@ - #if defined(__mips__) - struct kernel_sigaction { - unsigned int sa_flags; -- __sighandler_t k_sa_handler; -+ sighandler_t k_sa_handler; - sigset_t sa_mask; - }; - #else - struct kernel_sigaction { -- __sighandler_t k_sa_handler; -+ sighandler_t k_sa_handler; - unsigned long sa_flags; - void (*sa_restorer) (void); - sigset_t sa_mask; -diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile -index 37bc3a9..2ca7f7c 100644 ---- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile -+++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile -@@ -19,4 +19,7 @@ - top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/testcases.mk -+ -+CFLAGS += -D_GNU_SOURCE -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/external/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch deleted file mode 100644 index c2ef899c..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 31 May 2017 21:26:05 -0400 -Subject: [PATCH] Add periodic output for long time test. - -This is needed in context of having scripts running ltp tests and -waiting with a timeout for the output of the tests. - -Signed-off-by: Tudor Florea <tudor.florea@enea.com> -Upstream-Status: Pending - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -index af1a708..084e628 100755 ---- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then - exit 0 - fi - --RUN_TIME=$(( 15 * 60 )) -+ONE_MINUTE=60 -+RUN_TIME=15 - - cleanup() - { -@@ -62,7 +63,7 @@ do_mount() - # $1 - Number of cgroups - # $2 - Allocated how much memory in one process? in MB - # $3 - The interval to touch memory in a process --# $4 - How long does this test run ? in second -+# $4 - How long does this test run ? in minutes - run_stress() - { - do_mount; -@@ -81,7 +82,11 @@ run_stress() - eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null - done - -- sleep $4 -+ for i in $(seq 0 $(($4-1))) -+ do -+ eval echo "Started $i min ago. Still alive... " -+ sleep $ONE_MINUTE -+ done - - for i in $(seq 0 $(($1-1))) - do --- -2.8.1 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch b/external/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch deleted file mode 100644 index e7c927e1..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch +++ /dev/null @@ -1,252 +0,0 @@ -From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001 -From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com> -Date: Wed, 13 Sep 2017 15:48:42 +0800 -Subject: [PATCH] commands/ar01: Fix for test in deterministic mode - -If binutils was configured with --enable-deterministic-archives, -ar will run in deterministic mode by default, and use zero for -timestamps and uids/gids, which makes the test case abnormal. - -Fix this by add the "U" modifier when deterministic mode is default. - -Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com> -Signed-off-by: Fei Jie <feij.fnst@cn.fujitsu.com> - -Upstream-Status: Backport -[http://lists.linux.it/pipermail/ltp/2017-September/005668.html] - -Signed-off-by: Yi Zhao <yi.zhao@windriver.com> ---- - testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++-------------------- - 1 file changed, 52 insertions(+), 40 deletions(-) - -diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01 -index ddab2e0..d688f76 100644 ---- a/testcases/commands/ar/ar01 -+++ b/testcases/commands/ar/ar01 -@@ -23,14 +23,26 @@ - # This is a basic ar command test. - # - TST_CNT=17 -+TST_SETUP=setup - TST_TESTFUNC=test - TST_NEEDS_TMPDIR=1 - . tst_test.sh - -+setup() -+{ -+ ar --help | grep "use zero for timestamps and uids/gids (default)" \ -+ >/dev/null -+ if [ $? -eq 0 ]; then -+ MOD="U" -+ else -+ MOD="" -+ fi -+} -+ - test1() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -47,9 +59,9 @@ test1() - - test2() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in -- ROD ar -ma file1.in lib.a file4.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in -+ ROD ar -ma"$MOD" file1.in lib.a file4.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -66,8 +78,8 @@ test2() - - test3() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -84,9 +96,9 @@ test3() - - test4() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -mb file3.in lib.a file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -mb"$MOD" file3.in lib.a file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -103,7 +115,7 @@ test4() - - test5() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out - - if [ -s ar.out ]; then - tst_res TFAIL "ar produced output unexpectedly (-c)" -@@ -117,7 +129,7 @@ test5() - - test6() - { -- ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out -+ ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out - - if [ -s ar.out ]; then - tst_res TFAIL "ar produced output unexpectedly (-qc)" -@@ -131,9 +143,9 @@ test6() - - test7() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -d lib.a file1.in file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -d"$MOD" lib.a file1.in file2.in - ROD ar -t lib.a \> ar.out - - printf "file3.in\n" > ar.exp -@@ -150,9 +162,9 @@ test7() - - test8() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -d lib.a -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -d"$MOD" lib.a - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -169,8 +181,8 @@ test8() - - test9() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -187,9 +199,9 @@ test9() - - test10() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -mi file3.in lib.a file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -mi"$MOD" file3.in lib.a file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -206,9 +218,9 @@ test10() - - test11() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -m lib.a file3.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -m"$MOD" lib.a file3.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -225,9 +237,9 @@ test11() - - test12() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -p lib.a \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -p"$MOD" lib.a \> ar.out - - printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp - -@@ -244,9 +256,9 @@ test12() - test13() - { - -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -q lib.a $TST_DATAROOT/file4.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp -@@ -264,14 +276,14 @@ test13() - test14() - { - ROD touch file0.in -- ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in -+ ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in - - file0_mtime1=$(ar -tv lib.a | grep file0.in) - file1_mtime1=$(ar -tv lib.a | grep file1.in) - - touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in - -- ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in -+ ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in - - file0_mtime2=$(ar -tv lib.a | grep file0.in) - file1_mtime2=$(ar -tv lib.a | grep file1.in) -@@ -293,7 +305,7 @@ test14() - - test15() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in - ROD ar -tv lib.a \> ar.out - - if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then -@@ -308,9 +320,9 @@ test15() - - test16() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -xv lib.a \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -xv"$MOD" lib.a \> ar.out - - printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp - -@@ -332,8 +344,8 @@ test16() - - test17() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in -- ROD ar -xv lib.a file2.in \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in -+ ROD ar -xv"$MOD" lib.a file2.in \> ar.out - - printf "x - file2.in\n" > ar.exp - --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0040-read_all-Define-FNM_EXTMATCH-if-not-already-like-und.patch b/external/poky/meta/recipes-extended/ltp/ltp/0040-read_all-Define-FNM_EXTMATCH-if-not-already-like-und.patch deleted file mode 100644 index 0245a89f..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0040-read_all-Define-FNM_EXTMATCH-if-not-already-like-und.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 23518508de307790231d16af307291f1b45e903a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> -Date: Tue, 5 Jun 2018 15:36:30 -0500 -Subject: [PATCH] read_all: Define FNM_EXTMATCH if not already (like under - musl). -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With musl, FNM_EXTMATCH is not defined: -| read_all.c: In function 'read_test': -| read_all.c:201:41: error: 'FNM_EXTMATCH' undeclared (first use in this function); did you mean 'FNM_NOMATCH'? -| if (exclude && !fnmatch(exclude, path, FNM_EXTMATCH)) { -| ^~~~~~~~~~~~ -| FNM_NOMATCH -| read_all.c:201:41: note: each undeclared identifier is reported only once for each function it appears in -| <builtin>: recipe for target 'read_all' failed -| make[4]: *** [read_all] Error 1 - -Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> - -Upstream-Status: Pending ---- - testcases/kernel/fs/read_all/read_all.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c -index a8e1611..e9ff47a 100644 ---- a/testcases/kernel/fs/read_all/read_all.c -+++ b/testcases/kernel/fs/read_all/read_all.c -@@ -59,6 +59,10 @@ - #define MAX_PATH 4096 - #define MAX_DISPLAY 40 - -+#if !defined(FNM_EXTMATCH) -+#define FNM_EXTMATCH 0 -+#endif -+ - struct queue { - sem_t sem; - int front; --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0041-cve-2017-5669-shmat-for-0-or-PAGESIZE-with-RND-flag-.patch b/external/poky/meta/recipes-extended/ltp/ltp/0041-cve-2017-5669-shmat-for-0-or-PAGESIZE-with-RND-flag-.patch deleted file mode 100644 index 0d2d2cbc..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0041-cve-2017-5669-shmat-for-0-or-PAGESIZE-with-RND-flag-.patch +++ /dev/null @@ -1,97 +0,0 @@ -From b767b73ef027ba8d35f297c7d3659265ac80425b Mon Sep 17 00:00:00 2001 -From: Rafael David Tinoco <rafael.tinoco@canonical.com> -Date: Wed, 30 May 2018 09:14:34 -0300 -Subject: [PATCH] cve-2017-5669: shmat() for 0 (or <PAGESIZE with RND flag) has - to fail with REMAPs - -Fixes: https://github.com/linux-test-project/ltp/issues/319 - -According to upstream thread (https://lkml.org/lkml/2018/5/28/2056), -cve-2017-5669 needs to address the "new" way of handling nil addresses -for shmat() when used with MAP_FIXED or SHM_REMAP flags. - -- mapping nil-page is OK on lower addresses with MAP_FIXED (or else X11 is broken) -- mapping nil-page is NOT OK with SHM_REMAP on lower addresses - -Addresses Davidlohr Bueso's comments/changes: - -commit 8f89c007b6de -Author: Davidlohr Bueso <dave@stgolabs.net> -Date: Fri May 25 14:47:30 2018 -0700 - - ipc/shm: fix shmat() nil address after round-down when remapping - -commit a73ab244f0da -Author: Davidlohr Bueso <dave@stgolabs.net> -Date: Fri May 25 14:47:27 2018 -0700 - - Revert "ipc/shm: Fix shmat mmap nil-page protection" - -For previously test, and now broken, made based on: - -commit 95e91b831f87 -Author: Davidlohr Bueso <dave@stgolabs.net> -Date: Mon Feb 27 14:28:24 2017 -0800 - - ipc/shm: Fix shmat mmap nil-page protection - -Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org> -Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org> -Reviewed-by: Jan Stancek <jstancek@redhat.com> - -Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/pull/324] -CVE: CVE-2017-5669 -Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org> ---- - testcases/cve/cve-2017-5669.c | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/testcases/cve/cve-2017-5669.c b/testcases/cve/cve-2017-5669.c -index 1ca5983..0834626 100644 ---- a/testcases/cve/cve-2017-5669.c -+++ b/testcases/cve/cve-2017-5669.c -@@ -28,7 +28,20 @@ - * is just to see if we get an access error or some other unexpected behaviour. - * - * See commit 95e91b831f (ipc/shm: Fix shmat mmap nil-page protection) -+ * -+ * The commit above disallowed SHM_RND maps to zero (and rounded) entirely and -+ * that broke userland for cases like Xorg. New behavior disallows REMAPs to -+ * lower addresses (0<=PAGESIZE). -+ * -+ * See commit a73ab244f0da (Revert "ipc/shm: Fix shmat mmap nil-page protect...) -+ * See commit 8f89c007b6de (ipc/shm: fix shmat() nil address after round-dow...) -+ * See https://github.com/linux-test-project/ltp/issues/319 -+ * -+ * This test needs root permissions or else security_mmap_addr(), from -+ * get_unmapped_area(), will cause permission errors when trying to mmap lower -+ * addresses. - */ -+ - #include <sys/types.h> - #include <sys/ipc.h> - #include <sys/shm.h> -@@ -60,7 +73,11 @@ static void cleanup(void) - static void run(void) - { - tst_res(TINFO, "Attempting to attach shared memory to null page"); -- shm_addr = shmat(shm_id, ((void *)1), SHM_RND); -+ /* -+ * shmat() for 0 (or < PAGESIZE with RND flag) has to fail with REMAPs -+ * https://github.com/linux-test-project/ltp/issues/319 -+ */ -+ shm_addr = shmat(shm_id, ((void *)1), SHM_RND | SHM_REMAP); - if (shm_addr == (void *)-1) { - shm_addr = NULL; - if (errno == EINVAL) { -@@ -89,6 +106,7 @@ static void run(void) - } - - static struct tst_test test = { -+ .needs_root = 1, - .setup = setup, - .cleanup = cleanup, - .test_all = run, --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch b/external/poky/meta/recipes-extended/ltp/ltp/0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch deleted file mode 100644 index 407d98ef..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch +++ /dev/null @@ -1,34 +0,0 @@ -From baeef026f80e19a634a4096e97286419aca1cf68 Mon Sep 17 00:00:00 2001 -From: He Zhe <zhe.he@windriver.com> -Date: Thu, 23 Aug 2018 00:22:04 +0800 -Subject: [PATCH] fs/ftest/ftest06.c: Fix too small name string and related - failure - -The name string is too small to contain normal full path names and causes -the following failure. - -"ftest06 2 TFAIL : ftest06.c:223: Can't chdir(): errno=ENOENT(2): No such file or directory" - -Upstream-Status: Submitted [ltp-list@lists.sourceforge.net] - -Signed-off-by: He Zhe <zhe.he@windriver.com> ---- - testcases/kernel/fs/ftest/ftest06.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/kernel/fs/ftest/ftest06.c b/testcases/kernel/fs/ftest/ftest06.c -index 2ca7c88..b434067 100644 ---- a/testcases/kernel/fs/ftest/ftest06.c -+++ b/testcases/kernel/fs/ftest/ftest06.c -@@ -100,7 +100,7 @@ static char *fstyp; - int main(int ac, char *av[]) - { - int pid, child, status, count, k, j; -- char name[3]; -+ char name[MAXPATHLEN]; - - int lc; - --- -2.7.4 - diff --git a/external/poky/meta/recipes-extended/ltp/ltp/0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch b/external/poky/meta/recipes-extended/ltp/ltp/0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch deleted file mode 100644 index dc61fcc0..00000000 --- a/external/poky/meta/recipes-extended/ltp/ltp/0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 3c87ef2961dedb10d1f674c6a530e00dbab8ec1b Mon Sep 17 00:00:00 2001 -From: Jan Stancek <jstancek@redhat.com> -Date: Tue, 17 Jul 2018 10:26:39 +0200 -Subject: [PATCH] open|creat: skip S_ISGID check on files created by non-group - members - -0fa3ecd87848 ("Fix up non-directory creation in SGID directories") -fixes problem described in CVE-2018-13405. This commit is getting -backported to older streams as well. - -This patch removes S_ISGID check for files created by non-group members -in LTP tests creat08 and open10. - -Once 0fa3ecd87848 will be in non-rc kernel, we could add a new test -for this CVE that would be limited to 4.18+ kernels. - -Signed-off-by: Jan Stancek <jstancek@redhat.com> -Acked-by: Cyril Hrubis <chrubis@suse.cz> -Reviewed-by: Naresh Kamboju <naresh.kamboju@linaro.org> - -Upstream-Status: Backport -[ git://github.com/linux-test-project/ltp.git - 3c87ef2961dedb10d1f674c6a530e00dbab8ec1b - "open|creat: skip S_ISGID check on files created by non-group members" ] - -Signed-off-by: He Zhe <zhe.he@windriver.com> ---- - testcases/kernel/syscalls/creat/creat08.c | 13 ++++++------- - testcases/kernel/syscalls/open/open10.c | 12 +++++------- - 2 files changed, 11 insertions(+), 14 deletions(-) - -diff --git a/testcases/kernel/syscalls/creat/creat08.c b/testcases/kernel/syscalls/creat/creat08.c -index 50f2b3993..d22558ac3 100644 ---- a/testcases/kernel/syscalls/creat/creat08.c -+++ b/testcases/kernel/syscalls/creat/creat08.c -@@ -361,13 +361,12 @@ int main(int ac, char **av) - local_flag = FAILED; - } - -- /* Verify modes */ -- if (!(buf.st_mode & S_ISGID)) { -- tst_resm(TFAIL, -- "%s: Incorrect modes, setgid bit should be set", -- setgid_B); -- local_flag = FAILED; -- } -+ /* -+ * Skip S_ISGID check -+ * 0fa3ecd87848 ("Fix up non-directory creation in SGID directories") -+ * clears S_ISGID for files created by non-group members -+ */ -+ - close(fd); - - if (local_flag == PASSED) { -diff --git a/testcases/kernel/syscalls/open/open10.c b/testcases/kernel/syscalls/open/open10.c -index 613f2288f..14feec9e1 100644 ---- a/testcases/kernel/syscalls/open/open10.c -+++ b/testcases/kernel/syscalls/open/open10.c -@@ -345,13 +345,11 @@ int main(int ac, char *av[]) - local_flag = FAILED; - } - -- /* Verify modes */ -- if (!(buf.st_mode & S_ISGID)) { -- tst_resm(TFAIL, -- "%s: Incorrect modes, setgid bit not set", -- setgid_B); -- local_flag = FAILED; -- } -+ /* -+ * Skip S_ISGID check -+ * 0fa3ecd87848 ("Fix up non-directory creation in SGID directories") -+ * clears S_ISGID for files created by non-group members -+ */ - - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block2."); --- -2.11.0 - |