diff options
18 files changed, 123 insertions, 905 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ltp.py b/meta/lib/oeqa/runtime/cases/ltp.py index 30548640bc..b8b7300435 100644 --- a/meta/lib/oeqa/runtime/cases/ltp.py +++ b/meta/lib/oeqa/runtime/cases/ltp.py | |||
| @@ -57,7 +57,7 @@ class LtpTestBase(OERuntimeTestCase): | |||
| 57 | 57 | ||
| 58 | class LtpTest(LtpTestBase): | 58 | class LtpTest(LtpTestBase): |
| 59 | 59 | ||
| 60 | ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors","timers", "commands", "net.ipv6_lib", "input","fs_perms_simple"] | 60 | ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors", "commands", "net.ipv6_lib", "input","fs_perms_simple"] |
| 61 | 61 | ||
| 62 | ltp_fs = ["fs", "fsx", "fs_bind", "fs_ext4"] | 62 | ltp_fs = ["fs", "fsx", "fs_bind", "fs_ext4"] |
| 63 | # skip kernel cpuhotplug | 63 | # skip kernel cpuhotplug |
diff --git a/meta/recipes-extended/ltp/ltp/0001-Add-configure-time-check-for-getdents-getdents64-API.patch b/meta/recipes-extended/ltp/ltp/0001-Add-configure-time-check-for-getdents-getdents64-API.patch deleted file mode 100644 index bfceadb190..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-Add-configure-time-check-for-getdents-getdents64-API.patch +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | From 404dfeb4faef213b0450f173b60cd7080edec349 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 26 Jul 2019 10:32:29 -0700 | ||
| 4 | Subject: [PATCH 1/2] Add configure time check for getdents/getdents64 APIs | ||
| 5 | |||
| 6 | glibc 2.30 has added wrapper for getdents64 this will help in detecting | ||
| 7 | right condition to use fallback | ||
| 8 | |||
| 9 | Check for getdents API as well while here | ||
| 10 | |||
| 11 | Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-July/012954.html] | ||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | configure.ac | 2 ++ | ||
| 15 | testcases/kernel/syscalls/getdents/getdents.h | 8 ++++++-- | ||
| 16 | 2 files changed, 8 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | --- a/configure.ac | ||
| 19 | +++ b/configure.ac | ||
| 20 | @@ -65,6 +65,8 @@ AC_CHECK_FUNCS([ \ | ||
| 21 | fallocate \ | ||
| 22 | fchownat \ | ||
| 23 | fstatat \ | ||
| 24 | + getdents \ | ||
| 25 | + getdents64 \ | ||
| 26 | kcmp \ | ||
| 27 | mkdirat \ | ||
| 28 | mknodat \ | ||
| 29 | --- a/testcases/kernel/syscalls/getdents/getdents.h | ||
| 30 | +++ b/testcases/kernel/syscalls/getdents/getdents.h | ||
| 31 | @@ -23,7 +23,7 @@ | ||
| 32 | #include <stdint.h> | ||
| 33 | #include "test.h" | ||
| 34 | #include "lapi/syscalls.h" | ||
| 35 | - | ||
| 36 | +#include "config.h" | ||
| 37 | /* | ||
| 38 | * See fs/compat.c struct compat_linux_dirent | ||
| 39 | */ | ||
| 40 | @@ -34,12 +34,17 @@ struct linux_dirent { | ||
| 41 | char d_name[]; | ||
| 42 | }; | ||
| 43 | |||
| 44 | +#if HAVE_GETDENTS | ||
| 45 | +#include <unistd.h> | ||
| 46 | +#else | ||
| 47 | static inline int | ||
| 48 | getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) | ||
| 49 | { | ||
| 50 | return ltp_syscall(__NR_getdents, fd, dirp, size); | ||
| 51 | } | ||
| 52 | |||
| 53 | +#endif /* HAVE_GETDENTS */ | ||
| 54 | + | ||
| 55 | struct linux_dirent64 { | ||
| 56 | uint64_t d_ino; | ||
| 57 | int64_t d_off; | ||
| 58 | @@ -48,10 +53,13 @@ struct linux_dirent64 { | ||
| 59 | char d_name[]; | ||
| 60 | }; | ||
| 61 | |||
| 62 | +#if HAVE_GETDENTS64 | ||
| 63 | +#include <unistd.h> | ||
| 64 | +#else | ||
| 65 | static inline int | ||
| 66 | getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) | ||
| 67 | { | ||
| 68 | return ltp_syscall(__NR_getdents64, fd, dirp64, size); | ||
| 69 | } | ||
| 70 | - | ||
| 71 | +#endif /* HAVE_GETDENTS64 */ | ||
| 72 | #endif /* GETDENTS_H */ | ||
diff --git a/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch b/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch new file mode 100644 index 0000000000..d3af31f34a --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From 788c47ceef7f115ab7f7aa17f918e58795f4e6c7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 3 | Date: Fri, 20 Dec 2019 13:06:05 +0100 | ||
| 4 | Subject: [PATCH] Add more musl exclusions | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 8 | --- | ||
| 9 | testcases/kernel/syscalls/accept4/Makefile | 4 ++++ | ||
| 10 | testcases/kernel/syscalls/fanotify/Makefile | 6 ++++++ | ||
| 11 | testcases/kernel/syscalls/setxattr/Makefile | 4 ++++ | ||
| 12 | testcases/kernel/syscalls/timer_create/Makefile | 4 ++++ | ||
| 13 | 4 files changed, 18 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile | ||
| 16 | index 504042e11..94db06266 100644 | ||
| 17 | --- a/testcases/kernel/syscalls/accept4/Makefile | ||
| 18 | +++ b/testcases/kernel/syscalls/accept4/Makefile | ||
| 19 | @@ -20,4 +20,8 @@ top_srcdir ?= ../../../.. | ||
| 20 | |||
| 21 | include $(top_srcdir)/include/mk/testcases.mk | ||
| 22 | |||
| 23 | +ifeq ($(LIBC),musl) | ||
| 24 | +FILTER_OUT_MAKE_TARGETS := accept4_01 | ||
| 25 | +endif | ||
| 26 | + | ||
| 27 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
| 28 | diff --git a/testcases/kernel/syscalls/fanotify/Makefile b/testcases/kernel/syscalls/fanotify/Makefile | ||
| 29 | index 5d01b4825..0263a6e20 100644 | ||
| 30 | --- a/testcases/kernel/syscalls/fanotify/Makefile | ||
| 31 | +++ b/testcases/kernel/syscalls/fanotify/Makefile | ||
| 32 | @@ -20,4 +20,10 @@ top_srcdir ?= ../../../.. | ||
| 33 | fanotify11: CFLAGS+=-pthread | ||
| 34 | include $(top_srcdir)/include/mk/testcases.mk | ||
| 35 | |||
| 36 | +ifeq ($(LIBC),musl) | ||
| 37 | +FILTER_OUT_MAKE_TARGETS := fanotify13 fanotify15 | ||
| 38 | +endif | ||
| 39 | + | ||
| 40 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
| 41 | + | ||
| 42 | + | ||
| 43 | diff --git a/testcases/kernel/syscalls/setxattr/Makefile b/testcases/kernel/syscalls/setxattr/Makefile | ||
| 44 | index 72544c13e..7f20b2780 100644 | ||
| 45 | --- a/testcases/kernel/syscalls/setxattr/Makefile | ||
| 46 | +++ b/testcases/kernel/syscalls/setxattr/Makefile | ||
| 47 | @@ -20,4 +20,8 @@ top_srcdir ?= ../../../.. | ||
| 48 | |||
| 49 | include $(top_srcdir)/include/mk/testcases.mk | ||
| 50 | |||
| 51 | +ifeq ($(LIBC),musl) | ||
| 52 | +FILTER_OUT_MAKE_TARGETS := setxattr03 | ||
| 53 | +endif | ||
| 54 | + | ||
| 55 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | ||
| 56 | diff --git a/testcases/kernel/syscalls/timer_create/Makefile b/testcases/kernel/syscalls/timer_create/Makefile | ||
| 57 | index 8de247075..eb240f432 100644 | ||
| 58 | --- a/testcases/kernel/syscalls/timer_create/Makefile | ||
| 59 | +++ b/testcases/kernel/syscalls/timer_create/Makefile | ||
| 60 | @@ -20,6 +20,10 @@ top_srcdir ?= ../../../.. | ||
| 61 | |||
| 62 | include $(top_srcdir)/include/mk/testcases.mk | ||
| 63 | |||
| 64 | +ifeq ($(LIBC),musl) | ||
| 65 | +FILTER_OUT_MAKE_TARGETS := timer_create01 timer_create03 | ||
| 66 | +endif | ||
| 67 | + | ||
| 68 | CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include | ||
| 69 | |||
| 70 | LDLIBS += -lpthread -lrt | ||
diff --git a/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch index b5c25c56a5..1705abcf19 100644 --- a/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch +++ b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From ec282980e6eee96f5b74aba464141f86049263e6 Mon Sep 17 00:00:00 2001 | 1 | From 62c3481c73a2414d7a5f0a70808bfc9a06195bd9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 7 Jan 2016 18:19:03 +0000 | 3 | Date: Thu, 7 Jan 2016 18:19:03 +0000 |
| 4 | Subject: [PATCH] build: Add option to select libc implementation | 4 | Subject: [PATCH] build: Add option to select libc implementation |
| @@ -12,6 +12,7 @@ Disable tests specifically not building _yet_ on musl based systems | |||
| 12 | Upstream-Status: Pending | 12 | Upstream-Status: Pending |
| 13 | 13 | ||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | |||
| 15 | --- | 16 | --- |
| 16 | Makefile | 5 +++++ | 17 | Makefile | 5 +++++ |
| 17 | testcases/kernel/Makefile | 5 ++++- | 18 | testcases/kernel/Makefile | 5 ++++- |
| @@ -24,7 +25,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
| 24 | 8 files changed, 35 insertions(+), 2 deletions(-) | 25 | 8 files changed, 35 insertions(+), 2 deletions(-) |
| 25 | 26 | ||
| 26 | diff --git a/Makefile b/Makefile | 27 | diff --git a/Makefile b/Makefile |
| 27 | index 768ca46..e9d679a 100644 | 28 | index 768ca4606..e9d679a71 100644 |
| 28 | --- a/Makefile | 29 | --- a/Makefile |
| 29 | +++ b/Makefile | 30 | +++ b/Makefile |
| 30 | @@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include | 31 | @@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include |
| @@ -40,18 +41,19 @@ index 768ca46..e9d679a 100644 | |||
| 40 | # COMMON_TARGETS: Targets which exist in all, clean, and install. | 41 | # COMMON_TARGETS: Targets which exist in all, clean, and install. |
| 41 | # INSTALL_TARGETS: Targets which exist in clean and install (contains | 42 | # INSTALL_TARGETS: Targets which exist in clean and install (contains |
| 42 | diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile | 43 | diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile |
| 43 | index 39d79c7..24a57d9 100644 | 44 | index 3319b3163..94ea362c8 100644 |
| 44 | --- a/testcases/kernel/Makefile | 45 | --- a/testcases/kernel/Makefile |
| 45 | +++ b/testcases/kernel/Makefile | 46 | +++ b/testcases/kernel/Makefile |
| 46 | @@ -49,12 +49,15 @@ SUBDIRS += connectors \ | 47 | @@ -49,13 +49,16 @@ SUBDIRS += connectors \ |
| 47 | logging \ | 48 | logging \ |
| 48 | mem \ | 49 | mem \ |
| 49 | numa \ | 50 | numa \ |
| 50 | - pty \ | 51 | - pty \ |
| 51 | sched \ | 52 | sched \ |
| 52 | security \ | 53 | security \ |
| 53 | timers \ | 54 | sound \ |
| 54 | tracing \ | 55 | tracing \ |
| 56 | uevents \ | ||
| 55 | 57 | ||
| 56 | +ifneq ($(LIBC),musl) | 58 | +ifneq ($(LIBC),musl) |
| 57 | +SUBDIRS += pty | 59 | +SUBDIRS += pty |
| @@ -61,7 +63,7 @@ index 39d79c7..24a57d9 100644 | |||
| 61 | SUBDIRS += power_management | 63 | SUBDIRS += power_management |
| 62 | endif | 64 | endif |
| 63 | diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile | 65 | diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile |
| 64 | index 6a57d79..74bb933 100644 | 66 | index 6a57d79ee..74bb93370 100644 |
| 65 | --- a/testcases/kernel/sched/Makefile | 67 | --- a/testcases/kernel/sched/Makefile |
| 66 | +++ b/testcases/kernel/sched/Makefile | 68 | +++ b/testcases/kernel/sched/Makefile |
| 67 | @@ -23,5 +23,7 @@ | 69 | @@ -23,5 +23,7 @@ |
| @@ -74,7 +76,7 @@ index 6a57d79..74bb933 100644 | |||
| 74 | +endif | 76 | +endif |
| 75 | include $(top_srcdir)/include/mk/generic_trunk_target.mk | 77 | include $(top_srcdir)/include/mk/generic_trunk_target.mk |
| 76 | diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile | 78 | diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile |
| 77 | index 45a00cf..d1becd0 100644 | 79 | index 45a00cf7d..d1becd054 100644 |
| 78 | --- a/testcases/kernel/syscalls/Makefile | 80 | --- a/testcases/kernel/syscalls/Makefile |
| 79 | +++ b/testcases/kernel/syscalls/Makefile | 81 | +++ b/testcases/kernel/syscalls/Makefile |
| 80 | @@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) | 82 | @@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) |
| @@ -90,7 +92,7 @@ index 45a00cf..d1becd0 100644 | |||
| 90 | ifeq ($(UCLIBC),1) | 92 | ifeq ($(UCLIBC),1) |
| 91 | FILTER_OUT_DIRS += profil | 93 | FILTER_OUT_DIRS += profil |
| 92 | diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile | 94 | diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile |
| 93 | index 8c55a6b..f7cda62 100644 | 95 | index 8c55a6bbd..f7cda621d 100644 |
| 94 | --- a/testcases/network/nfsv4/acl/Makefile | 96 | --- a/testcases/network/nfsv4/acl/Makefile |
| 95 | +++ b/testcases/network/nfsv4/acl/Makefile | 97 | +++ b/testcases/network/nfsv4/acl/Makefile |
| 96 | @@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk | 98 | @@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk |
| @@ -103,7 +105,7 @@ index 8c55a6b..f7cda62 100644 | |||
| 103 | + | 105 | + |
| 104 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | 106 | include $(top_srcdir)/include/mk/generic_leaf_target.mk |
| 105 | diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile | 107 | diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile |
| 106 | index 66e9d56..ea8eb8a 100644 | 108 | index 66e9d5675..ea8eb8a98 100644 |
| 107 | --- a/testcases/network/rpc/basic_tests/Makefile | 109 | --- a/testcases/network/rpc/basic_tests/Makefile |
| 108 | +++ b/testcases/network/rpc/basic_tests/Makefile | 110 | +++ b/testcases/network/rpc/basic_tests/Makefile |
| 109 | @@ -23,4 +23,9 @@ | 111 | @@ -23,4 +23,9 @@ |
| @@ -117,7 +119,7 @@ index 66e9d56..ea8eb8a 100644 | |||
| 117 | + | 119 | + |
| 118 | include $(top_srcdir)/include/mk/generic_trunk_target.mk | 120 | include $(top_srcdir)/include/mk/generic_trunk_target.mk |
| 119 | diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile | 121 | diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile |
| 120 | index 68616a7..748754b 100644 | 122 | index 68616a711..748754bb4 100644 |
| 121 | --- a/testcases/realtime/func/pi-tests/Makefile | 123 | --- a/testcases/realtime/func/pi-tests/Makefile |
| 122 | +++ b/testcases/realtime/func/pi-tests/Makefile | 124 | +++ b/testcases/realtime/func/pi-tests/Makefile |
| 123 | @@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk | 125 | @@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk |
| @@ -131,7 +133,7 @@ index 68616a7..748754b 100644 | |||
| 131 | 133 | ||
| 132 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | 134 | include $(top_srcdir)/include/mk/generic_leaf_target.mk |
| 133 | diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile | 135 | diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile |
| 134 | index 1881f75..266e0b8 100644 | 136 | index 1881f7565..266e0b815 100644 |
| 135 | --- a/testcases/realtime/stress/pi-tests/Makefile | 137 | --- a/testcases/realtime/stress/pi-tests/Makefile |
| 136 | +++ b/testcases/realtime/stress/pi-tests/Makefile | 138 | +++ b/testcases/realtime/stress/pi-tests/Makefile |
| 137 | @@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. | 139 | @@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. |
| @@ -144,6 +146,3 @@ index 1881f75..266e0b8 100644 | |||
| 144 | +endif | 146 | +endif |
| 145 | + | 147 | + |
| 146 | include $(top_srcdir)/include/mk/generic_leaf_target.mk | 148 | include $(top_srcdir)/include/mk/generic_leaf_target.mk |
| 147 | -- | ||
| 148 | 2.7.4 | ||
| 149 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch b/meta/recipes-extended/ltp/ltp/0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch deleted file mode 100644 index cc40081300..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | From e3a8502d0a4f8a44ddd02ca4b2efc097133fb9f7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mathias Fiedler <mathias.fiedler@aox-tech.de> | ||
| 3 | Date: Fri, 23 Aug 2019 12:46:48 +0200 | ||
| 4 | Subject: [PATCH] cve-2017-17052: Avoid unsafe exits in threads | ||
| 5 | |||
| 6 | According to manpage exit(3) calling exit is not thread-safe. | ||
| 7 | And with glibc 2.28 (and probably also with glibc >=2.27) sometimes | ||
| 8 | child processes created in fork_thread can get stuck on process exit in | ||
| 9 | glibc's __run_exit_handlers trying to acquire some lock which was in | ||
| 10 | locked state while the fork was created. This can happen when exit is | ||
| 11 | called in mmap_thread concurrently to the fork. | ||
| 12 | While the main process will still return with PASSED some of its | ||
| 13 | children are left behind. | ||
| 14 | |||
| 15 | Comparing the source code with the original program as described in the | ||
| 16 | commit 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a of linux kernel >=4.13 | ||
| 17 | the exits in mmap_thread and fork_thread should not be necessary to | ||
| 18 | trigger the original bug. | ||
| 19 | |||
| 20 | Therefore those exit calls are removed. The mmap_thread and fork_thread | ||
| 21 | should still exit when their corresponding main thread in do_test_fork | ||
| 22 | calls exit_group. The remaining exit in do_test_fork will be called in | ||
| 23 | the main thread without any concurrent thread in the same process. | ||
| 24 | |||
| 25 | Signed-off-by: Mathias Fiedler <mathias.fiedler@aox-tech.de> | ||
| 26 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 27 | Acked-by: Jan Stancek <jstancek@redhat.com> | ||
| 28 | |||
| 29 | Upstream-Status: Backport | ||
| 30 | [https://github.com/linux-test-project/ltp/commit/9f0b452c1af4bcb54da35711eb3fa77334a350b4] | ||
| 31 | |||
| 32 | CVE: CVE-2017-17052 | ||
| 33 | |||
| 34 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 35 | --- | ||
| 36 | testcases/cve/cve-2017-17052.c | 5 ----- | ||
| 37 | 1 file changed, 5 deletions(-) | ||
| 38 | |||
| 39 | diff --git a/testcases/cve/cve-2017-17052.c b/testcases/cve/cve-2017-17052.c | ||
| 40 | index d7da7e919..18cd2a6d7 100644 | ||
| 41 | --- a/testcases/cve/cve-2017-17052.c | ||
| 42 | +++ b/testcases/cve/cve-2017-17052.c | ||
| 43 | @@ -58,8 +58,6 @@ static void *mmap_thread(void *arg) | ||
| 44 | for (;;) { | ||
| 45 | SAFE_MMAP(NULL, 0x1000000, PROT_READ, | ||
| 46 | MAP_POPULATE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); | ||
| 47 | - if (*do_exit) | ||
| 48 | - exit(0); | ||
| 49 | } | ||
| 50 | |||
| 51 | return arg; | ||
| 52 | @@ -67,9 +65,6 @@ static void *mmap_thread(void *arg) | ||
| 53 | |||
| 54 | static void *fork_thread(void *arg) | ||
| 55 | { | ||
| 56 | - if (*do_exit) | ||
| 57 | - exit(0); | ||
| 58 | - | ||
| 59 | usleep(rand() % 10000); | ||
| 60 | SAFE_FORK(); | ||
| 61 | |||
| 62 | -- | ||
| 63 | 2.17.1 | ||
| 64 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch b/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch deleted file mode 100644 index 94f6f5a15a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | From fbeda82f440a0098be42dd668cbc47212a86ab48 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: He Zhe <zhe.he@windriver.com> | ||
| 3 | Date: Wed, 21 Aug 2019 16:27:24 +0800 | ||
| 4 | Subject: [PATCH] cve/meltdown.c: Fix kernel symbol finding | ||
| 5 | |||
| 6 | meltdown case fails as below. | ||
| 7 | safe_file_ops.c:219: BROK: Expected 3 conversions got 2 at meltdown.c:272 | ||
| 8 | |||
| 9 | find_kernel_symbol is defined to try twice with each of /proc/kallsyms and | ||
| 10 | /boot/System.map-%s. Currently if the symbol is not found in /proc/kallsyms, | ||
| 11 | when kernel option CONFIG_KALLSYMS_ALL is disabled, it would stop the case | ||
| 12 | immediately due to SAFE_FILE_LINES_SCANF. | ||
| 13 | |||
| 14 | This patch turns to use FILE_LINES_SCANF to give find_kernel_symbol second | ||
| 15 | chance. | ||
| 16 | |||
| 17 | [jstancek] Fix also condition introduced in 7709d2ae92ea, even if | ||
| 18 | /proc/kallsyms is disabled, we still want to try System.map. | ||
| 19 | |||
| 20 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 21 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 22 | |||
| 23 | Upstream-Status: Backport | ||
| 24 | [https://github.com/linux-test-project/ltp/commit/c2049b5c874bc071f8185bffb5fd7dcb042d9ec8] | ||
| 25 | |||
| 26 | Remove the hunk for upstream 7709d2ae92ea ("cve/meltdown.c: abort the test if kallsyms was not enabled") | ||
| 27 | that has been covered by this patch. | ||
| 28 | |||
| 29 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 30 | --- | ||
| 31 | testcases/cve/meltdown.c | 13 ++++++++++--- | ||
| 32 | 1 file changed, 10 insertions(+), 3 deletions(-) | ||
| 33 | |||
| 34 | diff --git a/testcases/cve/meltdown.c b/testcases/cve/meltdown.c | ||
| 35 | index a53ea9b..22651a6 100644 | ||
| 36 | --- a/testcases/cve/meltdown.c | ||
| 37 | +++ b/testcases/cve/meltdown.c | ||
| 38 | @@ -267,9 +267,15 @@ find_symbol_in_file(const char *filename, const char *symname) | ||
| 39 | int ret, read; | ||
| 40 | char fmt[strlen(symname) + 64]; | ||
| 41 | |||
| 42 | + tst_res(TINFO, "Looking for %s in %s", symname, filename); | ||
| 43 | + if (access(filename, F_OK) == -1) { | ||
| 44 | + tst_res(TINFO, "%s not available", filename); | ||
| 45 | + return 0; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | sprintf(fmt, "%%lx %%c %s%%c", symname); | ||
| 49 | |||
| 50 | - ret = SAFE_FILE_LINES_SCANF(filename, fmt, &addr, &type, &read); | ||
| 51 | + ret = FILE_LINES_SCANF(filename, fmt, &addr, &type, &read); | ||
| 52 | if (ret) | ||
| 53 | return 0; | ||
| 54 | |||
| 55 | @@ -287,13 +293,11 @@ find_kernel_symbol(const char *name) | ||
| 56 | if (addr) | ||
| 57 | return addr; | ||
| 58 | |||
| 59 | - tst_res(TINFO, "not found '%s' in /proc/kallsyms", name); | ||
| 60 | if (uname(&utsname) < 0) | ||
| 61 | tst_brk(TBROK | TERRNO, "uname"); | ||
| 62 | |||
| 63 | sprintf(systemmap, "/boot/System.map-%s", utsname.release); | ||
| 64 | |||
| 65 | - tst_res(TINFO, "looking in '%s'\n", systemmap); | ||
| 66 | addr = find_symbol_in_file(systemmap, name); | ||
| 67 | return addr; | ||
| 68 | } | ||
| 69 | @@ -308,6 +312,9 @@ static void setup(void) | ||
| 70 | saved_cmdline_addr = find_kernel_symbol("saved_command_line"); | ||
| 71 | tst_res(TINFO, "&saved_command_line == 0x%lx", saved_cmdline_addr); | ||
| 72 | |||
| 73 | + if (!saved_cmdline_addr) | ||
| 74 | + tst_brk(TCONF, "saved_command_line not found"); | ||
| 75 | + | ||
| 76 | spec_fd = SAFE_OPEN("/proc/cmdline", O_RDONLY); | ||
| 77 | |||
| 78 | memset(target_array, 1, sizeof(target_array)); | ||
| 79 | -- | ||
| 80 | 2.7.4 | ||
| 81 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch b/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch deleted file mode 100644 index bed84712a1..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | From d656a447893dccc310c975a239f482278550c3e0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Stancek <jstancek@redhat.com> | ||
| 3 | Date: Tue, 21 May 2019 10:10:44 +0200 | ||
| 4 | Subject: [PATCH] overcommit_memory: update for "mm: fix false-positive | ||
| 5 | OVERCOMMIT_GUESS failures" | ||
| 6 | |||
| 7 | commit 8c7829b04c52 ("mm: fix false-positive OVERCOMMIT_GUESS failures") | ||
| 8 | changes logic of __vm_enough_memory(), simplifying it to: | ||
| 9 | When in GUESS mode, catch wild allocations by comparing their request | ||
| 10 | size to total amount of ram and swap in the system. | ||
| 11 | |||
| 12 | Testcase currently allocates mem_total + swap_total, which doesn't trigger | ||
| 13 | new condition. Make it more extreme, but assuming free_total / 2 will PASS, | ||
| 14 | and 2*sum_total will FAIL. | ||
| 15 | |||
| 16 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 17 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 18 | |||
| 19 | Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/d656a447893dccc310c975a239f482278550c3e0] | ||
| 20 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 21 | --- | ||
| 22 | testcases/kernel/mem/tunable/overcommit_memory.c | 11 ++++------- | ||
| 23 | 1 file changed, 4 insertions(+), 7 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/testcases/kernel/mem/tunable/overcommit_memory.c b/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 26 | index 555298f..345764d 100644 | ||
| 27 | --- a/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 28 | +++ b/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 29 | @@ -36,11 +36,10 @@ | ||
| 30 | * | ||
| 31 | * The program is designed to test the two tunables: | ||
| 32 | * | ||
| 33 | - * When overcommit_memory = 0, allocatable memory can't overextends | ||
| 34 | - * the amount of free memory. I choose the three cases: | ||
| 35 | + * When overcommit_memory = 0, allocatable memory can't overextend | ||
| 36 | + * the amount of total memory: | ||
| 37 | * a. less than free_total: free_total / 2, alloc should pass. | ||
| 38 | - * b. greater than free_total: free_total * 2, alloc should fail. | ||
| 39 | - * c. equal to sum_total: sum_tatal, alloc should fail | ||
| 40 | + * b. greater than sum_total: sum_total * 2, alloc should fail. | ||
| 41 | * | ||
| 42 | * When overcommit_memory = 1, it can alloc enough much memory, I | ||
| 43 | * choose the three cases: | ||
| 44 | @@ -164,9 +163,7 @@ static void overcommit_memory_test(void) | ||
| 45 | |||
| 46 | update_mem(); | ||
| 47 | alloc_and_check(free_total / 2, EXPECT_PASS); | ||
| 48 | - update_mem(); | ||
| 49 | - alloc_and_check(free_total * 2, EXPECT_FAIL); | ||
| 50 | - alloc_and_check(sum_total, EXPECT_FAIL); | ||
| 51 | + alloc_and_check(sum_total * 2, EXPECT_FAIL); | ||
| 52 | |||
| 53 | /* start to test overcommit_memory=1 */ | ||
| 54 | set_sys_tune("overcommit_memory", 1, 1); | ||
| 55 | -- | ||
| 56 | 2.7.4 | ||
| 57 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch b/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch deleted file mode 100644 index 0e56c08255..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | From a5046625eaeed2d3fba456c3ba84c6c141c2ad7c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: He Zhe <zhe.he@windriver.com> | ||
| 3 | Date: Thu, 29 Aug 2019 21:09:46 +0800 | ||
| 4 | Subject: [PATCH] syscall/rt_sigtimedwait01: Fix wrong sigset length for MIPS | ||
| 5 | |||
| 6 | rt_sigtimedwait01 fails as follow on MIPS arches | ||
| 7 | rt_sigtimedwait01 1 TFAIL : .../sigwaitinfo01.c:58: test_empty_set | ||
| 8 | (.../sigwaitinfo01.c: 148): Unexpected failure: | ||
| 9 | TEST_ERRNO=EINVAL(22): Invalid argument | ||
| 10 | |||
| 11 | As this case purposely bypasses glibc, it should align with the size of kernel | ||
| 12 | definition of sigset_t which is different from other arches. | ||
| 13 | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/signal.h#n15 | ||
| 14 | |||
| 15 | This patch turns to use _NSIG which is always right for all arches. | ||
| 16 | |||
| 17 | Upstream-Status: Backport [a5046625eaeed2d3fba456c3ba84c6c141c2ad7c] | ||
| 18 | |||
| 19 | Suggested-by: Jan Stancek <jstancek@redhat.com> | ||
| 20 | Acked-by: Jan Stancek <jstancek@redhat.com> | ||
| 21 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 22 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 23 | Signed-off-by: Petr Vorel <pvorel@suse.cz> | ||
| 24 | --- | ||
| 25 | testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 5 ++--- | ||
| 26 | 1 file changed, 2 insertions(+), 3 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 29 | index 5a32ce1..6a30c27 100644 | ||
| 30 | --- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 31 | +++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 32 | @@ -128,9 +128,8 @@ static int my_sigtimedwait(const sigset_t * set, siginfo_t * info, | ||
| 33 | static int my_rt_sigtimedwait(const sigset_t * set, siginfo_t * info, | ||
| 34 | struct timespec *timeout) | ||
| 35 | { | ||
| 36 | - | ||
| 37 | - /* The last argument is (number_of_signals)/(bits_per_byte), which are 64 and 8, resp. */ | ||
| 38 | - return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, 8); | ||
| 39 | + /* _NSIG is always the right number of bits of signal map for all arches */ | ||
| 40 | + return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, _NSIG/8); | ||
| 41 | } | ||
| 42 | #endif | ||
| 43 | |||
| 44 | -- | ||
| 45 | 2.7.4 | ||
| 46 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch deleted file mode 100644 index 6ea26150fb..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 1 | From e747d0456adc080a1d31fb653bda9dc491795c80 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Stancek <jstancek@redhat.com> | ||
| 3 | Date: Sun, 16 Jun 2019 11:14:16 +0200 | ||
| 4 | Subject: [PATCH] syscalls/tgkill03: wait for defunct tid to get detached | ||
| 5 | |||
| 6 | Case where defunct tid is used has been observed to sporadically fail: | ||
| 7 | tgkill03.c:96: FAIL: Defunct tid should have failed with ESRCH: SUCCESS | ||
| 8 | |||
| 9 | glibc __pthread_timedjoin_ex() waits for CLONE_CHILD_CLEARTID to clear tid, | ||
| 10 | and then resumes. Kernel clears it (glibc pd->tid) at: | ||
| 11 | do_exit | ||
| 12 | exit_mm | ||
| 13 | mm_release | ||
| 14 | put_user(0, tsk->clear_child_tid); | ||
| 15 | |||
| 16 | but kernel tid is still valid, presumably until: | ||
| 17 | release_task | ||
| 18 | __exit_signal | ||
| 19 | __unhash_process | ||
| 20 | detach_pid | ||
| 21 | |||
| 22 | To avoid race wait until /proc/<pid>/task/<tid> disappears. | ||
| 23 | |||
| 24 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 25 | Reviewed-by: Li Wang <liwang@redhat.com> | ||
| 26 | Acked-by: Sumit Garg <sumit.garg@linaro.org> | ||
| 27 | |||
| 28 | Upstream-Status: Backport | ||
| 29 | [https://github.com/linux-test-project/ltp/commit/e747d0456adc080a1d31fb653bda9dc491795c80] | ||
| 30 | |||
| 31 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 32 | --- | ||
| 33 | testcases/kernel/syscalls/tgkill/tgkill03.c | 6 +++++- | ||
| 34 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 35 | |||
| 36 | diff --git a/testcases/kernel/syscalls/tgkill/tgkill03.c b/testcases/kernel/syscalls/tgkill/tgkill03.c | ||
| 37 | index f5bbdc5..593a217 100644 | ||
| 38 | --- a/testcases/kernel/syscalls/tgkill/tgkill03.c | ||
| 39 | +++ b/testcases/kernel/syscalls/tgkill/tgkill03.c | ||
| 40 | @@ -7,6 +7,7 @@ | ||
| 41 | |||
| 42 | #include <pthread.h> | ||
| 43 | #include <pwd.h> | ||
| 44 | +#include <stdio.h> | ||
| 45 | #include <sys/types.h> | ||
| 46 | |||
| 47 | #include "tst_safe_pthread.h" | ||
| 48 | @@ -42,6 +43,7 @@ static void setup(void) | ||
| 49 | { | ||
| 50 | sigset_t sigusr1; | ||
| 51 | pthread_t defunct_thread; | ||
| 52 | + char defunct_tid_path[PATH_MAX]; | ||
| 53 | |||
| 54 | sigemptyset(&sigusr1); | ||
| 55 | sigaddset(&sigusr1, SIGUSR1); | ||
| 56 | @@ -55,8 +57,9 @@ static void setup(void) | ||
| 57 | TST_CHECKPOINT_WAIT(0); | ||
| 58 | |||
| 59 | SAFE_PTHREAD_CREATE(&defunct_thread, NULL, defunct_thread_func, NULL); | ||
| 60 | - | ||
| 61 | SAFE_PTHREAD_JOIN(defunct_thread, NULL); | ||
| 62 | + sprintf(defunct_tid_path, "/proc/%d/task/%d", getpid(), defunct_tid); | ||
| 63 | + TST_RETRY_FN_EXP_BACKOFF(access(defunct_tid_path, R_OK), -1, 15); | ||
| 64 | } | ||
| 65 | |||
| 66 | static void cleanup(void) | ||
| 67 | @@ -108,4 +111,5 @@ static struct tst_test test = { | ||
| 68 | .setup = setup, | ||
| 69 | .cleanup = cleanup, | ||
| 70 | .test = run, | ||
| 71 | + .timeout = 20, | ||
| 72 | }; | ||
| 73 | -- | ||
| 74 | 2.7.4 | ||
| 75 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch b/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch new file mode 100644 index 0000000000..9330844509 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | From 476ce907fa18042cdde0a244ba9a46cd895ce76c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 3 | Date: Thu, 12 Dec 2019 17:56:02 +0100 | ||
| 4 | Subject: [PATCH] testcases: fix an absent format string issue | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 8 | --- | ||
| 9 | .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | 2 +- | ||
| 10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 11 | |||
| 12 | diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | ||
| 13 | index 27dbc6626..19d943d06 100644 | ||
| 14 | --- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | ||
| 15 | +++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | ||
| 16 | @@ -59,7 +59,7 @@ static void verify_pidfd_send_signal(void) | ||
| 17 | |||
| 18 | /* Manipulate PID for next process */ | ||
| 19 | sprintf(pid_str, "%d", pid - 1); | ||
| 20 | - SAFE_FILE_PRINTF(last_pid_file, pid_str); | ||
| 21 | + SAFE_FILE_PRINTF(last_pid_file, "%s", pid_str); | ||
| 22 | |||
| 23 | new_pid = SAFE_FORK(); | ||
| 24 | if (new_pid == 0) { | ||
diff --git a/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch b/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch deleted file mode 100644 index f4f87f38ab..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-testcases-use-python3-everywhere-to-run-python-scrip.patch +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | From 0463d793566772a606255957915f99d166d5740c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 3 | Date: Wed, 28 Aug 2019 18:30:23 +0200 | ||
| 4 | Subject: [PATCH] testcases: use python3 everywhere to run python scripts | ||
| 5 | |||
| 6 | The scripts themselves have #!/usr/bin/python3 in them, | ||
| 7 | so I trust they are already py3-compatible. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
| 11 | --- | ||
| 12 | testcases/kernel/power_management/runpwtests05.sh | 2 +- | ||
| 13 | .../power_management/runpwtests_exclusive01.sh | 2 +- | ||
| 14 | .../power_management/runpwtests_exclusive02.sh | 2 +- | ||
| 15 | .../power_management/runpwtests_exclusive03.sh | 2 +- | ||
| 16 | .../power_management/runpwtests_exclusive04.sh | 2 +- | ||
| 17 | .../power_management/runpwtests_exclusive05.sh | 2 +- | ||
| 18 | testcases/network/nfsv4/acl/runtest | 14 +++++++------- | ||
| 19 | testcases/realtime/func/pi-tests/run_auto.sh | 6 +++--- | ||
| 20 | 8 files changed, 16 insertions(+), 16 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/testcases/kernel/power_management/runpwtests05.sh b/testcases/kernel/power_management/runpwtests05.sh | ||
| 23 | index 8a7d0f6e0..43e234d01 100755 | ||
| 24 | --- a/testcases/kernel/power_management/runpwtests05.sh | ||
| 25 | +++ b/testcases/kernel/power_management/runpwtests05.sh | ||
| 26 | @@ -35,7 +35,7 @@ else | ||
| 27 | max_sched_smt=1 | ||
| 28 | fi | ||
| 29 | |||
| 30 | -tst_test_cmds python | ||
| 31 | +tst_test_cmds python3 | ||
| 32 | |||
| 33 | if ! grep sched_debug -qw /proc/cmdline ; then | ||
| 34 | tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \ | ||
| 35 | diff --git a/testcases/kernel/power_management/runpwtests_exclusive01.sh b/testcases/kernel/power_management/runpwtests_exclusive01.sh | ||
| 36 | index ec78319e2..9fefcbf6e 100755 | ||
| 37 | --- a/testcases/kernel/power_management/runpwtests_exclusive01.sh | ||
| 38 | +++ b/testcases/kernel/power_management/runpwtests_exclusive01.sh | ||
| 39 | @@ -35,7 +35,7 @@ else | ||
| 40 | max_sched_smt=1 | ||
| 41 | fi | ||
| 42 | |||
| 43 | -tst_test_cmds python | ||
| 44 | +tst_test_cmds python3 | ||
| 45 | |||
| 46 | hyper_threaded=$(is_hyper_threaded) | ||
| 47 | multi_socket=$(is_multi_socket) | ||
| 48 | diff --git a/testcases/kernel/power_management/runpwtests_exclusive02.sh b/testcases/kernel/power_management/runpwtests_exclusive02.sh | ||
| 49 | index e107fce35..2cd0ecb05 100755 | ||
| 50 | --- a/testcases/kernel/power_management/runpwtests_exclusive02.sh | ||
| 51 | +++ b/testcases/kernel/power_management/runpwtests_exclusive02.sh | ||
| 52 | @@ -33,7 +33,7 @@ else | ||
| 53 | max_sched_smt=1 | ||
| 54 | fi | ||
| 55 | |||
| 56 | -tst_test_cmds python | ||
| 57 | +tst_test_cmds python3 | ||
| 58 | |||
| 59 | hyper_threaded=$(is_hyper_threaded) | ||
| 60 | multi_socket=$(is_multi_socket) | ||
| 61 | diff --git a/testcases/kernel/power_management/runpwtests_exclusive03.sh b/testcases/kernel/power_management/runpwtests_exclusive03.sh | ||
| 62 | index 490344bb3..ab3a5d11d 100755 | ||
| 63 | --- a/testcases/kernel/power_management/runpwtests_exclusive03.sh | ||
| 64 | +++ b/testcases/kernel/power_management/runpwtests_exclusive03.sh | ||
| 65 | @@ -35,7 +35,7 @@ else | ||
| 66 | max_sched_smt=1 | ||
| 67 | fi | ||
| 68 | |||
| 69 | -tst_test_cmds python | ||
| 70 | +tst_test_cmds python3 | ||
| 71 | |||
| 72 | hyper_threaded=$(is_hyper_threaded) | ||
| 73 | multi_socket=$(is_multi_socket) | ||
| 74 | diff --git a/testcases/kernel/power_management/runpwtests_exclusive04.sh b/testcases/kernel/power_management/runpwtests_exclusive04.sh | ||
| 75 | index 978ca02ae..438ef603f 100755 | ||
| 76 | --- a/testcases/kernel/power_management/runpwtests_exclusive04.sh | ||
| 77 | +++ b/testcases/kernel/power_management/runpwtests_exclusive04.sh | ||
| 78 | @@ -27,7 +27,7 @@ export TST_TOTAL=2 | ||
| 79 | # Checking test environment | ||
| 80 | check_kervel_arch | ||
| 81 | |||
| 82 | -tst_test_cmds python | ||
| 83 | +tst_test_cmds python3 | ||
| 84 | |||
| 85 | hyper_threaded=$(is_hyper_threaded) | ||
| 86 | multi_socket=$(is_multi_socket) | ||
| 87 | diff --git a/testcases/kernel/power_management/runpwtests_exclusive05.sh b/testcases/kernel/power_management/runpwtests_exclusive05.sh | ||
| 88 | index a0dad5834..3a9afdbf2 100755 | ||
| 89 | --- a/testcases/kernel/power_management/runpwtests_exclusive05.sh | ||
| 90 | +++ b/testcases/kernel/power_management/runpwtests_exclusive05.sh | ||
| 91 | @@ -35,7 +35,7 @@ else | ||
| 92 | max_sched_smt=1 | ||
| 93 | fi | ||
| 94 | |||
| 95 | -tst_test_cmds python | ||
| 96 | +tst_test_cmds python3 | ||
| 97 | |||
| 98 | hyper_threaded=$(is_hyper_threaded) | ||
| 99 | multi_socket=$(is_multi_socket) | ||
| 100 | diff --git a/testcases/network/nfsv4/acl/runtest b/testcases/network/nfsv4/acl/runtest | ||
| 101 | index d2e1b4c49..a859e85bc 100755 | ||
| 102 | --- a/testcases/network/nfsv4/acl/runtest | ||
| 103 | +++ b/testcases/network/nfsv4/acl/runtest | ||
| 104 | @@ -22,7 +22,7 @@ do | ||
| 105 | done | ||
| 106 | |||
| 107 | # creation of users on the remote machine (removed only at the end of the tests) | ||
| 108 | -rsh -n $REMOTEHOST python $PWD/create_users.py -u 50 -g 50 | ||
| 109 | +rsh -n $REMOTEHOST python3 $PWD/create_users.py -u 50 -g 50 | ||
| 110 | |||
| 111 | echo "Starting ACL testing" | ||
| 112 | |||
| 113 | @@ -51,19 +51,19 @@ echo "Basic tests finished" | ||
| 114 | |||
| 115 | echo "LONG ACL TEST" | ||
| 116 | echo "creating necessary users and groups" | ||
| 117 | -python create_users.py -u 50 -g 50 | ||
| 118 | +python3 create_users.py -u 50 -g 50 | ||
| 119 | echo "creating necessary users and groups on the remote host" | ||
| 120 | mkdir $NFSMNTDIR/lacl-testdir | ||
| 121 | -python test_long_acl.py -l $MAXLENGTH -p $NFSMNTDIR/lacl-testdir | ||
| 122 | +python3 test_long_acl.py -l $MAXLENGTH -p $NFSMNTDIR/lacl-testdir | ||
| 123 | rm -rf $NFSMNTDIR/lacl-testdir | ||
| 124 | echo "Long ACL test OK with $MAXLENGTH entries" | ||
| 125 | echo "ACL STRESSING TEST" | ||
| 126 | -python setacl_stress.py -n 100 -u $USER_NB -g $GRP_NB -f $FILE_NB -p $NFSMNTDIR | ||
| 127 | +python3 setacl_stress.py -n 100 -u $USER_NB -g $GRP_NB -f $FILE_NB -p $NFSMNTDIR | ||
| 128 | |||
| 129 | # remove local an remote users | ||
| 130 | -python cleanusers.py | ||
| 131 | -python cleangroups.py | ||
| 132 | -rsh -n $REMOTEHOST python $PWD/cleanusers.py | ||
| 133 | +python3 cleanusers.py | ||
| 134 | +python3 cleangroups.py | ||
| 135 | +rsh -n $REMOTEHOST python3 $PWD/cleanusers.py | ||
| 136 | |||
| 137 | echo "Test OK" | ||
| 138 | |||
| 139 | diff --git a/testcases/realtime/func/pi-tests/run_auto.sh b/testcases/realtime/func/pi-tests/run_auto.sh | ||
| 140 | index d13026049..277988568 100755 | ||
| 141 | --- a/testcases/realtime/func/pi-tests/run_auto.sh | ||
| 142 | +++ b/testcases/realtime/func/pi-tests/run_auto.sh | ||
| 143 | @@ -15,15 +15,15 @@ $SCRIPTS_DIR/run_c_files.sh $profile testpi-0 | ||
| 144 | |||
| 145 | export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-1.log" | ||
| 146 | $SCRIPTS_DIR/run_c_files.sh $profile testpi-1 | ||
| 147 | -PYTHONPATH=../../ python parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 148 | +PYTHONPATH=../../ python3 parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 149 | |||
| 150 | export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-2.log" | ||
| 151 | $SCRIPTS_DIR/run_c_files.sh $profile testpi-2 | ||
| 152 | -PYTHONPATH=../../ python parse-testpi2.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 153 | +PYTHONPATH=../../ python3 parse-testpi2.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 154 | |||
| 155 | export LOG_FILE="$LOG_DIR/$LOG_FORMAT-testpi-4.log" | ||
| 156 | $SCRIPTS_DIR/run_c_files.sh $profile testpi-4 | ||
| 157 | -PYTHONPATH=../../ python parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 158 | +PYTHONPATH=../../ python3 parse-testpi1.py $LOG_FILE 2>&1 | tee -a $LOG_FILE | ||
| 159 | |||
| 160 | |||
| 161 | export LOG_FILE="" | ||
diff --git a/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch b/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch deleted file mode 100644 index c936b788fe..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | From 156776a3e29491b363fdc9811912e1298655d060 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Steven Price <steven.price@arm.com> | ||
| 3 | Date: Fri, 19 Jul 2019 13:48:17 +0100 | ||
| 4 | Subject: [PATCH] ustat02: Fix EFAULT in 32bit compatibility mode | ||
| 5 | |||
| 6 | The size of dev_t is larger than 32 bits which causes the dev argument | ||
| 7 | to be passed incorrectly. On Arm this means that the EFAULT test case | ||
| 8 | actually returns EINVAL because the device number isn't recognised. | ||
| 9 | |||
| 10 | Signed-off-by: Steven Price <steven.price@arm.com> | ||
| 11 | Acked-by: Li Wang <liwang@redhat.com> | ||
| 12 | |||
| 13 | Upstream-Status: Backport | ||
| 14 | [https://github.com/linux-test-project/ltp/commit/156776a3e29491b363fdc9811912e1298655d060] | ||
| 15 | |||
| 16 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 17 | --- | ||
| 18 | testcases/kernel/syscalls/ustat/ustat02.c | 2 +- | ||
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c | ||
| 22 | index 9bbe4f3..1a0e9e0 100644 | ||
| 23 | --- a/testcases/kernel/syscalls/ustat/ustat02.c | ||
| 24 | +++ b/testcases/kernel/syscalls/ustat/ustat02.c | ||
| 25 | @@ -36,7 +36,7 @@ int TST_TOTAL = ARRAY_SIZE(tc); | ||
| 26 | |||
| 27 | void run(unsigned int test) | ||
| 28 | { | ||
| 29 | - TEST(tst_syscall(__NR_ustat, *tc[test].dev, tc[test].buf)); | ||
| 30 | + TEST(tst_syscall(__NR_ustat, (unsigned int)*tc[test].dev, tc[test].buf)); | ||
| 31 | |||
| 32 | if ((TST_RET == -1) && (TST_ERR == tc[test].exp_errno)) | ||
| 33 | tst_res(TPASS | TTERRNO, "ustat(2) expected failure"); | ||
| 34 | -- | ||
| 35 | 2.7.4 | ||
| 36 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0002-check-for-RES_USE_INET6-during-configure.patch b/meta/recipes-extended/ltp/ltp/0002-check-for-RES_USE_INET6-during-configure.patch deleted file mode 100644 index 12e47eb2b6..0000000000 --- a/meta/recipes-extended/ltp/ltp/0002-check-for-RES_USE_INET6-during-configure.patch +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | From 7bc134545b7beb09717a60541530c20a1a5740d3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 26 Jul 2019 10:55:28 -0700 | ||
| 4 | Subject: [PATCH 2/2] check for RES_USE_INET6 during configure | ||
| 5 | |||
| 6 | glibc 2.30 has remove RES_USE_INET6 define which has been on its way out | ||
| 7 | since 2.26 release, this check ensures that we detect it before using it | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-July/012955.html] | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | configure.ac | 13 +++++++++++++ | ||
| 13 | testcases/network/multicast/mc_gethost/mc_gethost.c | 6 ++++++ | ||
| 14 | 2 files changed, 19 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/configure.ac b/configure.ac | ||
| 17 | index 2255b5c181..ed7acccb01 100644 | ||
| 18 | --- a/configure.ac | ||
| 19 | +++ b/configure.ac | ||
| 20 | @@ -91,6 +91,19 @@ AC_CHECK_FUNCS([ \ | ||
| 21 | vmsplice \ | ||
| 22 | ]) | ||
| 23 | |||
| 24 | +#check defines | ||
| 25 | +AC_MSG_CHECKING([for RES_USE_INET6]) | ||
| 26 | +AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <resolv.h>]], | ||
| 27 | + [[char dummy[RES_USE_INET6];]])], | ||
| 28 | + [ | ||
| 29 | + AC_MSG_RESULT([yes]) | ||
| 30 | + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 1, [Define to 1 if you have the RES_USE_INET6 macro.]) | ||
| 31 | + ], | ||
| 32 | + [ | ||
| 33 | + AC_MSG_RESULT([no]) | ||
| 34 | + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 0, [Define to 1 if you have the RES_USE_INET6 macro.]) | ||
| 35 | + ] | ||
| 36 | +) | ||
| 37 | # Tools knobs | ||
| 38 | |||
| 39 | # Expect | ||
| 40 | diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c | ||
| 41 | index 9cc15d086b..d1cae5441a 100644 | ||
| 42 | --- a/testcases/network/multicast/mc_gethost/mc_gethost.c | ||
| 43 | +++ b/testcases/network/multicast/mc_gethost/mc_gethost.c | ||
| 44 | @@ -17,6 +17,8 @@ | ||
| 45 | #include <string.h> | ||
| 46 | #include <stdlib.h> | ||
| 47 | |||
| 48 | +#include "config.h" | ||
| 49 | + | ||
| 50 | #ifndef LOG_PERROR | ||
| 51 | #define LOG_PERROR 0 | ||
| 52 | #endif | ||
| 53 | @@ -50,8 +52,12 @@ usage: | ||
| 54 | argv++, argc--; | ||
| 55 | } | ||
| 56 | if (argc >= 1 && !strcmp(*argv, "-6")) { | ||
| 57 | +#if HAVE_RES_USE_INET6 | ||
| 58 | af = AF_INET6, size = IN6ADDRSZ; | ||
| 59 | _res.options |= RES_USE_INET6; | ||
| 60 | +#else | ||
| 61 | + af = AF_INET, size = INADDRSZ; | ||
| 62 | +#endif | ||
| 63 | argv++, argc--; | ||
| 64 | } | ||
| 65 | if (argc >= 1 && !strcmp(*argv, "-f")) { | ||
| 66 | -- | ||
| 67 | 2.22.0 | ||
| 68 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch index c0f69ecf5f..df3e8831f5 100644 --- a/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +++ b/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 29ce9fdab3bd34e69d73b5b890795559c06553f7 Mon Sep 17 00:00:00 2001 | 1 | From 1ce47a6ed811fd78ed04ea2f82e6321c6bca57b6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 7 Jan 2016 19:40:08 +0000 | 3 | Date: Thu, 7 Jan 2016 19:40:08 +0000 |
| 4 | Subject: [PATCH] Check if __GLIBC_PREREQ is defined before using it | 4 | Subject: [PATCH] Check if __GLIBC_PREREQ is defined before using it |
| @@ -10,16 +10,17 @@ Upstream-Status: Pending | |||
| 10 | 10 | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | 12 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> |
| 13 | |||
| 13 | --- | 14 | --- |
| 14 | testcases/kernel/syscalls/accept4/accept4_01.c | 7 +++++++ | 15 | testcases/kernel/syscalls/accept4/accept4_01.c | 7 +++++++ |
| 15 | 1 file changed, 7 insertions(+) | 16 | 1 file changed, 7 insertions(+) |
| 16 | 17 | ||
| 17 | diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c | 18 | diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c |
| 18 | index dd289cf..76aa969 100644 | 19 | index 29e18f27d..07444a46f 100644 |
| 19 | --- a/testcases/kernel/syscalls/accept4/accept4_01.c | 20 | --- a/testcases/kernel/syscalls/accept4/accept4_01.c |
| 20 | +++ b/testcases/kernel/syscalls/accept4/accept4_01.c | 21 | +++ b/testcases/kernel/syscalls/accept4/accept4_01.c |
| 21 | @@ -38,6 +38,7 @@ | 22 | @@ -38,6 +38,7 @@ |
| 22 | static struct sockaddr_in conn_addr; | 23 | static struct sockaddr_in *conn_addr, *accept_addr; |
| 23 | static int listening_fd; | 24 | static int listening_fd; |
| 24 | 25 | ||
| 25 | +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) | 26 | +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) |
| @@ -34,25 +35,21 @@ index dd289cf..76aa969 100644 | |||
| 34 | 35 | ||
| 35 | static int create_listening_socket(void) | 36 | static int create_listening_socket(void) |
| 36 | { | 37 | { |
| 37 | @@ -115,6 +117,7 @@ static void verify_accept4(unsigned int nr) | 38 | @@ -114,12 +116,17 @@ static void verify_accept4(unsigned int nr) |
| 38 | SAFE_CONNECT(connfd, (struct sockaddr *)&conn_addr, sizeof(conn_addr)); | 39 | SAFE_CONNECT(connfd, (struct sockaddr *)conn_addr, sizeof(*conn_addr)); |
| 39 | addrlen = sizeof(claddr); | 40 | addrlen = sizeof(*accept_addr); |
| 40 | 41 | ||
| 41 | +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) | 42 | +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) |
| 42 | #if !(__GLIBC_PREREQ(2, 10)) | 43 | #if !(__GLIBC_PREREQ(2, 10)) |
| 43 | TEST(accept4_01(listening_fd, (struct sockaddr *)&claddr, &addrlen, | 44 | TEST(accept4_01(listening_fd, (struct sockaddr *)accept_addr, &addrlen, |
| 44 | tcase->cloexec | tcase->nonblock)); | 45 | tcase->cloexec | tcase->nonblock)); |
| 45 | @@ -122,6 +125,10 @@ static void verify_accept4(unsigned int nr) | 46 | #else |
| 46 | TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, | 47 | TEST(accept4(listening_fd, (struct sockaddr *)accept_addr, &addrlen, |
| 47 | tcase->cloexec | tcase->nonblock)); | 48 | tcase->cloexec | tcase->nonblock)); |
| 48 | #endif | 49 | +#endif |
| 49 | +#else | 50 | +#else |
| 50 | + TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, | 51 | + TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, |
| 51 | + tcase->cloexec | tcase->nonblock)); | 52 | + tcase->cloexec | tcase->nonblock)); |
| 52 | +#endif | 53 | #endif |
| 53 | if (TST_RET == -1) { | 54 | if (TST_RET == -1) { |
| 54 | if (TST_ERR == ENOSYS) | 55 | if (TST_ERR == ENOSYS) |
| 55 | tst_brk(TCONF, "syscall __NR_accept4 not supported"); | ||
| 56 | -- | ||
| 57 | 2.7.4 | ||
| 58 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch b/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch deleted file mode 100644 index 8704e5ffe8..0000000000 --- a/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch +++ /dev/null | |||
| @@ -1,82 +0,0 @@ | |||
| 1 | From 794933b38354a2612cf2c471f11798b306f35315 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Stancek <jstancek@redhat.com> | ||
| 3 | Date: Mon, 20 May 2019 20:47:20 +0200 | ||
| 4 | Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test | ||
| 5 | |||
| 6 | Test fails on SHM_STAT testcase: | ||
| 7 | shmctl01 5 TFAIL : shmctl01.c:173: shmctl01 call failed | ||
| 8 | errno = 22 : Invalid argument | ||
| 9 | shmctl(0, SHM_STAT, 0x601060) = -EINVAL | ||
| 10 | |||
| 11 | since following commit: | ||
| 12 | commit 99db46ea292780cd978d56932d9445b1e8bdafe8 | ||
| 13 | Author: Manfred Spraul <manfred@colorfullife.com> | ||
| 14 | Date: Tue May 14 15:46:36 2019 -0700 | ||
| 15 | ipc: do cyclic id allocation for the ipc object. | ||
| 16 | |||
| 17 | Don't rely on index 0 being always available, but instead | ||
| 18 | use (maximum) index returned by SHM_INFO. | ||
| 19 | |||
| 20 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 21 | Reviewed-by: Petr Vorel <pvorel@suse.cz> | ||
| 22 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 23 | |||
| 24 | Upstream-Status: Backport | ||
| 25 | [https://github.com/linux-test-project/ltp/commit/db0a43d9388be2c347a8306751bbe6bec086d062] | ||
| 26 | |||
| 27 | Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com> | ||
| 28 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 29 | --- | ||
| 30 | testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++--- | ||
| 31 | 1 file changed, 18 insertions(+), 3 deletions(-) | ||
| 32 | |||
| 33 | diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
| 34 | index 1b46977..52bf23a 100644 | ||
| 35 | --- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
| 36 | +++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
| 37 | @@ -79,6 +79,7 @@ static void func_info(int ret); | ||
| 38 | |||
| 39 | /* Check routine for SHM_STAT */ | ||
| 40 | static void func_sstat(int ret); | ||
| 41 | +static void func_sstat_setup(void); | ||
| 42 | |||
| 43 | /* Check routine for SHM_LOCK */ | ||
| 44 | static void func_lock(int ret); | ||
| 45 | @@ -110,7 +111,7 @@ static struct test_case_t { | ||
| 46 | #endif | ||
| 47 | {&shm_id_1, IPC_SET, &buf, func_set, set_setup}, | ||
| 48 | {&shm_id_1, IPC_INFO, (struct shmid_ds *) &info, func_info, NULL}, | ||
| 49 | - {&shm_index, SHM_STAT, &buf, func_sstat, NULL}, | ||
| 50 | + {&shm_index, SHM_STAT, &buf, func_sstat, func_sstat_setup}, | ||
| 51 | {&shm_id_1, SHM_LOCK, NULL, func_lock, NULL}, | ||
| 52 | {&shm_id_1, SHM_UNLOCK, NULL, func_unlock, NULL}, | ||
| 53 | {&shm_id_1, IPC_RMID, NULL, func_rmid, NULL}, | ||
| 54 | @@ -407,9 +408,23 @@ static void func_info(int ret) | ||
| 55 | static void func_sstat(int ret) | ||
| 56 | { | ||
| 57 | if (ret >= 0) | ||
| 58 | - tst_resm(TPASS, "get correct shared memory id"); | ||
| 59 | + tst_resm(TPASS, "get correct shared memory id for index: %d", | ||
| 60 | + shm_index); | ||
| 61 | else | ||
| 62 | - tst_resm(TFAIL, "shared memory id is incorrect"); | ||
| 63 | + tst_resm(TFAIL, "shared memory id is incorrect, index: %d", | ||
| 64 | + shm_index); | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +static void func_sstat_setup(void) | ||
| 68 | +{ | ||
| 69 | + struct shm_info tmp; | ||
| 70 | + int ret; | ||
| 71 | + | ||
| 72 | + ret = shmctl(shm_id_1, SHM_INFO, (void *)&tmp); | ||
| 73 | + if (ret < 0) | ||
| 74 | + tst_resm(TFAIL|TERRNO, "shmctl(SHM_INFO)"); | ||
| 75 | + else | ||
| 76 | + shm_index = ret; | ||
| 77 | } | ||
| 78 | |||
| 79 | static void func_lock(int ret) | ||
| 80 | -- | ||
| 81 | 2.7.4 | ||
| 82 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch b/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch deleted file mode 100644 index 9cd188f656..0000000000 --- a/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | From f210d7e19b721041f31b7f258a169f89dc850303 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Stancek <jstancek@redhat.com> | ||
| 3 | Date: Thu, 4 Jul 2019 16:45:23 +0200 | ||
| 4 | Subject: [PATCH] direct_io/diotest4: drop MAP_FIXED | ||
| 5 | |||
| 6 | Hongzhi reports that this test is failing on mips64 with 5.1+: | ||
| 7 | diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument | ||
| 8 | diotest4 11 TBROK : diotest4.c:368: Remaining cases broken | ||
| 9 | I could reproduce it on emulated 5kc-malta, running 5.2.0-rc7. | ||
| 10 | |||
| 11 | Test is trying to map into area immediately following heap as MAP_SHARED, | ||
| 12 | but it used wrong alignment (fixed by 'lapi/mmap.h: include config.h'). | ||
| 13 | |||
| 14 | Usage of MAP_FIXED seems unnecessary, so drop that too and let the kernel | ||
| 15 | pick an address. | ||
| 16 | |||
| 17 | Reported-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
| 18 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 19 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 20 | |||
| 21 | Upstream-Status: Backport | ||
| 22 | [https://github.com/linux-test-project/ltp/commit/f5444eeeabf252b8884b9465d277b6af853819e3] | ||
| 23 | |||
| 24 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 25 | --- | ||
| 26 | testcases/kernel/io/direct_io/diotest4.c | 8 ++------ | ||
| 27 | 1 file changed, 2 insertions(+), 6 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c | ||
| 30 | index e4616e4..bf200cd 100644 | ||
| 31 | --- a/testcases/kernel/io/direct_io/diotest4.c | ||
| 32 | +++ b/testcases/kernel/io/direct_io/diotest4.c | ||
| 33 | @@ -352,18 +352,14 @@ int main(int argc, char *argv[]) | ||
| 34 | total++; | ||
| 35 | |||
| 36 | /* Test-10: read, write to a mmaped file */ | ||
| 37 | - shm_base = (char *)(((long)sbrk(0) + (shmsz - 1)) & ~(shmsz - 1)); | ||
| 38 | - if (shm_base == NULL) { | ||
| 39 | - tst_brkm(TBROK, cleanup, "sbrk failed: %s", strerror(errno)); | ||
| 40 | - } | ||
| 41 | offset = 4096; | ||
| 42 | count = bufsize; | ||
| 43 | if ((fd = open(filename, O_DIRECT | O_RDWR)) < 0) { | ||
| 44 | tst_brkm(TBROK, cleanup, "can't open %s: %s", | ||
| 45 | filename, strerror(errno)); | ||
| 46 | } | ||
| 47 | - shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE, | ||
| 48 | - MAP_SHARED | MAP_FIXED, fd, 0); | ||
| 49 | + shm_base = mmap(0, 0x100000, PROT_READ | PROT_WRITE, | ||
| 50 | + MAP_SHARED, fd, 0); | ||
| 51 | if (shm_base == (caddr_t) - 1) { | ||
| 52 | tst_brkm(TBROK, cleanup, "can't mmap file: %s", | ||
| 53 | strerror(errno)); | ||
| 54 | -- | ||
| 55 | 2.7.4 | ||
| 56 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch b/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch deleted file mode 100644 index aecbc80e9b..0000000000 --- a/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | From 4ac747c1f7ff8e2ec2567d6672822e95a9b56e55 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Hongzhi.Song" <hongzhi.song@windriver.com> | ||
| 3 | Date: Mon, 15 Jul 2019 03:39:06 -0400 | ||
| 4 | Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32 | ||
| 5 | |||
| 6 | Error info: | ||
| 7 | getrlimit03.c:104: FAIL: __NR_prlimit64(0) had rlim_cur = | ||
| 8 | ffffffffffffffff but __NR_getrlimit(0) had rlim_cur = 7fffffff | ||
| 9 | |||
| 10 | According to kernel code: [arch/mips/include/uapi/asm/resource.h] | ||
| 11 | RLIM_INFINITY is set to 0x7fffffffUL instead of ULONG_MAX on mips32. | ||
| 12 | |||
| 13 | /* | ||
| 14 | * SuS says limits have to be unsigned. | ||
| 15 | * Which makes a ton more sense anyway, | ||
| 16 | * but we keep the old value on MIPS32, | ||
| 17 | * for compatibility: | ||
| 18 | */ | ||
| 19 | #ifndef __mips64 | ||
| 20 | # define RLIM_INFINITY 0x7fffffffUL | ||
| 21 | #endif | ||
| 22 | |||
| 23 | Adding conditional statement about mips to fix this. | ||
| 24 | |||
| 25 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 26 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
| 27 | |||
| 28 | Upstream-Status: Backport | ||
| 29 | [https://github.com/linux-test-project/ltp/commit/7a3bca63cd7f059d490b6274f0fdf3247be93fde] | ||
| 30 | |||
| 31 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
| 32 | --- | ||
| 33 | testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++- | ||
| 34 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
| 35 | |||
| 36 | diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
| 37 | index e4d56c4..319bc49 100644 | ||
| 38 | --- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
| 39 | +++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
| 40 | @@ -26,6 +26,7 @@ | ||
| 41 | |||
| 42 | #include "tst_test.h" | ||
| 43 | #include "lapi/syscalls.h" | ||
| 44 | +#include "lapi/abisize.h" | ||
| 45 | |||
| 46 | /** | ||
| 47 | * Linux provides an "old" getrlimit syscall handler that uses signed long, | ||
| 48 | @@ -61,7 +62,12 @@ struct rlimit_ulong { | ||
| 49 | unsigned long rlim_cur; | ||
| 50 | unsigned long rlim_max; | ||
| 51 | }; | ||
| 52 | -const unsigned long RLIM_INFINITY_UL = ULONG_MAX; | ||
| 53 | + | ||
| 54 | +#if defined(__mips__) && defined(TST_ABI32) | ||
| 55 | + const unsigned long RLIM_INFINITY_UL = 0x7fffffffUL; | ||
| 56 | +#else | ||
| 57 | + const unsigned long RLIM_INFINITY_UL = ULONG_MAX; | ||
| 58 | +#endif | ||
| 59 | |||
| 60 | static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) | ||
| 61 | { | ||
| 62 | -- | ||
| 63 | 2.7.4 | ||
| 64 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20190517.bb b/meta/recipes-extended/ltp/ltp_20190930.bb index 60f749b4c0..e56bb575d2 100644 --- a/meta/recipes-extended/ltp/ltp_20190517.bb +++ b/meta/recipes-extended/ltp/ltp_20190930.bb | |||
| @@ -27,7 +27,7 @@ CFLAGS_append_x86-64 = " -fomit-frame-pointer" | |||
| 27 | 27 | ||
| 28 | CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" | 28 | CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" |
| 29 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" | 29 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" |
| 30 | SRCREV = "ac33ef87f0b9dc56533026435be3ea8c67ce86d2" | 30 | SRCREV = "c9707b465a08397569920b676345474f44327200" |
| 31 | 31 | ||
| 32 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ | 32 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ |
| 33 | file://0001-build-Add-option-to-select-libc-implementation.patch \ | 33 | file://0001-build-Add-option-to-select-libc-implementation.patch \ |
| @@ -38,19 +38,9 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 38 | file://0007-Fix-test_proc_kill-hanging.patch \ | 38 | file://0007-Fix-test_proc_kill-hanging.patch \ |
| 39 | file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ | 39 | file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ |
| 40 | file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ | 40 | file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ |
| 41 | file://0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ | ||
| 42 | file://0011-direct_io-diotest4-drop-MAP_FIXED.patch \ | ||
| 43 | file://0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch \ | ||
| 44 | file://0001-Add-configure-time-check-for-getdents-getdents64-API.patch \ | ||
| 45 | file://0002-check-for-RES_USE_INET6-during-configure.patch \ | ||
| 46 | file://0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch \ | ||
| 47 | file://0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch \ | ||
| 48 | file://0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch \ | ||
| 49 | file://0001-testcases-use-python3-everywhere-to-run-python-scrip.patch \ | ||
| 50 | file://0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch \ | ||
| 51 | file://0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch \ | ||
| 52 | file://0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch \ | ||
| 53 | file://0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch \ | 41 | file://0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch \ |
| 42 | file://0001-testcases-fix-an-absent-format-string-issue.patch \ | ||
| 43 | file://0001-Add-more-musl-exclusions.patch \ | ||
| 54 | " | 44 | " |
| 55 | 45 | ||
| 56 | S = "${WORKDIR}/git" | 46 | S = "${WORKDIR}/git" |
