Return-Path: Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by arago-project.org (Postfix) with ESMTPS id 6B90E520DF for ; Wed, 12 Aug 2020 22:42:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id EACF640BAD; Wed, 12 Aug 2020 22:39:13 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9_K5UZ7hZSrT; Wed, 12 Aug 2020 22:39:13 +0000 (UTC) Received: from mail.denix.org (pool-100-15-86-127.washdc.fios.verizon.net [100.15.86.127]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id C19C440BBB; Wed, 12 Aug 2020 22:39:12 +0000 (UTC) Received: from gimli.denix (unknown [192.168.30.6]) by mail.denix.org (Postfix) with ESMTP id 7C68F174073; Wed, 12 Aug 2020 18:39:12 -0400 (EDT) From: Denys Dmytriyenko To: meta-arago@arago-project.org Date: Wed, 12 Aug 2020 18:39:10 -0400 Message-Id: <1597271951-32491-2-git-send-email-denys@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1597271951-32491-1-git-send-email-denys@ti.com> References: <1597271951-32491-1-git-send-email-denys@ti.com> MIME-Version: 1.0 Subject: [master][PATCH 2/3] ltp: overlay 20200120 locally, as ltp-ddt is based on it X-BeenThere: meta-arago@arago-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Arago metadata layer for TI SDKs - OE-Core/Yocto compatible List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2020 22:42:03 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Denys Dmytriyenko --- .../recipes-devtools/ltp-ddt/ltp-ddt_20200120.bb | 1 + .../ltp/ltp/0001-Add-more-musl-exclusions.patch | 44 ++++++++ ...-Add-option-to-select-libc-implementation.patch | 102 +++++++++++++++++ ...eck-for-time64-unsafe-syscalls-before-usi.patch | 122 +++++++++++++++++++++ ...__GLIBC_PREREQ-is-defined-before-using-it.patch | 55 ++++++++++ .../ltp/0004-guard-mallocopt-with-__GLIBC__.patch | 34 ++++++ .../ltp/ltp/0007-Fix-test_proc_kill-hanging.patch | 32 ++++++ ...etwork-nfsv4-acl-acl1.c-Security-fix-on-s.patch | 42 +++++++ .../recipes-extended/ltp/ltp_20200120.bb | 122 +++++++++++++++++++++ 9 files changed, 554 insertions(+) create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch create mode 100644 meta-arago-extras/recipes-extended/ltp/ltp_20200120.bb diff --git a/meta-arago-extras/recipes-devtools/ltp-ddt/ltp-ddt_20200120.bb b/meta-arago-extras/recipes-devtools/ltp-ddt/ltp-ddt_20200120.bb index 85a3427..56a644e 100644 --- a/meta-arago-extras/recipes-devtools/ltp-ddt/ltp-ddt_20200120.bb +++ b/meta-arago-extras/recipes-devtools/ltp-ddt/ltp-ddt_20200120.bb @@ -1,4 +1,5 @@ FILESEXTRAPATHS_prepend := "${COREBASE}/meta/recipes-extended/ltp/ltp:" +FILESEXTRAPATHS_prepend := "${ARAGOBASE}/meta-arago-extras/recipes-extended/ltp/ltp:" require recipes-extended/ltp/ltp_${PV}.bb diff --git a/meta-arago-extras/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch new file mode 100644 index 0000000..02c2fef --- /dev/null +++ b/meta-arago-extras/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 +Date: Fri, 20 Dec 2019 13:06:05 +0100 +Subject: [PATCH] Add more musl exclusions + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin +[ pvorel: rebase for 20200120: enable fanotify13, fanotify15, setxattr03 ] +Signed-off-by: Petr Vorel +--- + 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/meta-arago-extras/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch new file mode 100644 index 0000000..b1a9995 --- /dev/null +++ b/meta-arago-extras/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 +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 '} 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 +[ 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 +Signed-off-by: Petr Vorel +--- + 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/meta-arago-extras/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch new file mode 100644 index 0000000..ac8f08e --- /dev/null +++ b/meta-arago-extras/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 +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 +Reviewed-by: Yang Xu +Reviewed-by: Petr Vorel +Signed-off-by: Petr Vorel +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 + */ + +-/* +- * clock_gettime() and clock_getres() functions +- */ +- +-#define _GNU_SOURCE +-#include + #include +-#include + ++#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 + #include + #include "test.h" +-#include + #include +- +-#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 + #include + #include +-#include + #include + #include + #include + + #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/meta-arago-extras/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch new file mode 100644 index 0000000..df3e883 --- /dev/null +++ b/meta-arago-extras/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 +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 +Signed-off-by: Yi Zhao + +--- + 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/meta-arago-extras/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch new file mode 100644 index 0000000..5622a64 --- /dev/null +++ b/meta-arago-extras/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch @@ -0,0 +1,34 @@ +From d0fc9ca5d3366f9b8907e463222403cd2327be10 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 8 Jan 2016 06:51:20 +0000 +Subject: [PATCH] guard mallocopt() with __GLIBC__ + +mallocopt is not available on non glibc implementations + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c +index 5bb8eff..934d951 100644 +--- a/utils/benchmark/ebizzy-0.3/ebizzy.c ++++ b/utils/benchmark/ebizzy-0.3/ebizzy.c +@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[]) + "\"never mmap\" option specified\n"); + usage(); + } +- ++#ifdef __GLIBC__ + if (never_mmap) + mallopt(M_MMAP_MAX, 0); +- ++#endif + if (chunk_size < record_size) { + fprintf(stderr, "Chunk size %u smaller than record size %u\n", + chunk_size, record_size); +-- +2.7.4 + diff --git a/meta-arago-extras/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch new file mode 100644 index 0000000..0e72645 --- /dev/null +++ b/meta-arago-extras/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch @@ -0,0 +1,32 @@ +From f4fafbdffae3a63c81f65cef98c72dda26283e06 Mon Sep 17 00:00:00 2001 +From: Dengke Du +Date: Wed, 8 Feb 2017 16:17:17 +0800 +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 +Signed-off-by: Dengke Du +--- + 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 aadaae4..deea5d6 100755 +--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh ++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh +@@ -291,6 +291,7 @@ test_proc_kill() + pid=$! + TST_CHECKPOINT_WAIT 0 + echo $pid > tasks ++ sleep 1 + + signal_memcg_process $pid $3 + +-- +2.7.4 + diff --git a/meta-arago-extras/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/meta-arago-extras/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch new file mode 100644 index 0000000..350091a --- /dev/null +++ b/meta-arago-extras/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch @@ -0,0 +1,42 @@ +From 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= +Date: Fri, 13 May 2016 11:11:28 -0500 +Subject: [PATCH] acl: Security fix on string printf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes build error when compiled with -Werror=format-security: + +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 +Signed-off-by: Petr Vorel +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 aae9484e5..ad778cd33 100644 +--- a/testcases/network/nfsv4/acl/acl1.c ++++ b/testcases/network/nfsv4/acl/acl1.c +@@ -302,7 +302,7 @@ void test_acl_default(char *dir, acl_t acl) + char *cmd = malloc(256); + + strcpy(cmd, "chmod 7777 "); +- printf(cmd); ++ printf(cmd, NULL); + strcat(cmd, dir); + system(cmd); + acl2 = acl_get_file(path, ACL_TYPE_ACCESS); +-- +2.25.1 + diff --git a/meta-arago-extras/recipes-extended/ltp/ltp_20200120.bb b/meta-arago-extras/recipes-extended/ltp/ltp_20200120.bb new file mode 100644 index 0000000..6633755 --- /dev/null +++ b/meta-arago-extras/recipes-extended/ltp/ltp_20200120.bb @@ -0,0 +1,122 @@ +SUMMARY = "Linux Test Project" +DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features." +HOMEPAGE = "https://linux-test-project.github.io/" +SECTION = "console/utils" +LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause" +LIC_FILES_CHKSUM = "\ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ + file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \ + file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ + file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ + file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ + file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ +" + +DEPENDS = "attr libaio libcap acl openssl zip-native" +DEPENDS_append_libc-musl = " fts " +EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " +EXTRA_OECONF_append_libc-musl = " LIBS=-lfts " + +# since ltp contains x86-64 assembler which uses the frame-pointer register, +# set -fomit-frame-pointer x86-64 to handle cases where optimisation +# is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer +# earlier in CFLAGS, etc. +CFLAGS_append_x86-64 = " -fomit-frame-pointer" + +CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" +CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" +SRCREV = "4079aaf264d0e9ead042b59d1c5f4e643620d0d5" + +SRC_URI = "git://github.com/linux-test-project/ltp.git \ + file://0001-build-Add-option-to-select-libc-implementation.patch \ + file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ + file://0004-guard-mallocopt-with-__GLIBC__.patch \ + file://0007-Fix-test_proc_kill-hanging.patch \ + file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ + file://0001-Add-more-musl-exclusions.patch \ + file://0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch \ + " + +S = "${WORKDIR}/git" + +inherit autotools-brokensep + +TARGET_CC_ARCH += "${LDFLAGS}" + +export prefix = "/opt/${PN}" +export exec_prefix = "/opt/${PN}" + +PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," +EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" +EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite --with-open-posix-testsuite " +# ltp network/rpc test cases ftbfs when libtirpc is found +EXTRA_OECONF += " --without-tirpc " + +do_install(){ + install -d ${D}${prefix}/ + oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install + + # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run + # as it lacks dependency on some perl moudle such as LWP::Simple + # And this script previously works as a tool for analyzing failures from LTP + # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses + # http://khack.osdl.org to retrieve ltp test results run on + # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible + rm -rf ${D}${prefix}/bin/STPfailure_report.pl + + # Copy POSIX test suite into ${D}${prefix}/testcases by manual + cp -r testcases/open_posix_testsuite ${D}${prefix}/testcases + + # Makefile were configured in the build system + find ${D}${prefix} -name Makefile | xargs -n 1 sed -i \ + -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*--sysroot=[^ "]*@@g' + + # The controllers memcg_stree test seems to cause us hangs and takes 900s + # (maybe we expect more regular output?), anyhow, skip it + sed -e '/^memcg_stress/d' -i ${D}${prefix}/runtest/controllers +} + +RDEPENDS_${PN} = "\ + attr \ + bash \ + bc \ + coreutils \ + cpio \ + cronie \ + curl \ + e2fsprogs \ + e2fsprogs-mke2fs \ + expect \ + file \ + gawk \ + gdb \ + gzip \ + iproute2 \ + ldd \ + libaio \ + logrotate \ + perl \ + python3-core \ + procps \ + quota \ + unzip \ + util-linux \ + which \ + tar \ +" + +FILES_${PN} += "${prefix}/* ${prefix}/runtest/* ${prefix}/scenario_groups/* ${prefix}/testcases/bin/* ${prefix}/testcases/bin/*/bin/* ${prefix}/testscripts/* ${prefix}/testcases/open_posix_testsuite/* ${prefix}/testcases/open_posix_testsuite/conformance/* ${prefix}/testcases/open_posix_testsuite/Documentation/* ${prefix}/testcases/open_posix_testsuite/functional/* ${prefix}/testcases/open_posix_testsuite/include/* ${prefix}/testcases/open_posix_testsuite/scripts/* ${prefix}/testcases/open_posix_testsuite/stress/* ${prefix}/testcases/open_posix_testsuite/tools/* ${prefix}/testcases/data/nm01/lib.a ${prefix}/lib/libmem.a" + +# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail +INHIBIT_PACKAGE_STRIP_FILES = "${prefix}/testcases/bin/nm01 ${prefix}/testcases/bin/ldd01" +INSANE_SKIP_${PN} += "already-stripped staticdev" + +# Avoid file dependency scans, as LTP checks for things that may or may not +# exist on the running system. For instance it has specific checks for +# csh and ksh which are not typically part of OpenEmbedded systems (but +# can be added via additional layers.) +SKIP_FILEDEPS_${PN} = '1' -- 2.7.4