summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-07-19 13:13:18 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-19 16:16:31 +0100
commiteb59546c83f4c217de6272a8d3b2fa65e3c84e7f (patch)
tree14dc4443c52624707fb9043ad82bb1455f6e6538 /meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch
parent84d08b0bed9e1c5f223f9ec437bb8d96a2bda599 (diff)
downloadopenembedded-core-contrib-eb59546c83f4c217de6272a8d3b2fa65e3c84e7f.tar.gz
ltp: upgrade 20190115 -> 20190517
Drop the following patches since the issues have been fixed upstream: 0001-file01.sh-Fix-in-was-not-recognized.patch 0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch 0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch 0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch 0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch 0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch 0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch 0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch 0026-crash01-Define-_GNU_SOURCE.patch 0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch 0034-periodic_output.patch 0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch define-sigrtmin-and-sigrtmax-for-musl.patch setregid01-security-string-formatting.patch Refresh the following patches: 0004-build-Add-option-to-select-libc-implementation.patch 0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch 0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch 0018-guard-mallocopt-with-__GLIBC__.patch 0020-getdents-define-getdents-getdents64-only-for-glibc.patch 0035-fix-test_proc_kill-hang.patch 0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch 0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch 0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch 0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch 0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch Add patch: 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch')
-rw-r--r--meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch82
1 files changed, 82 insertions, 0 deletions
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
new file mode 100644
index 0000000000..8704e5ffe8
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch
@@ -0,0 +1,82 @@
+From 794933b38354a2612cf2c471f11798b306f35315 Mon Sep 17 00:00:00 2001
+From: Jan Stancek <jstancek@redhat.com>
+Date: Mon, 20 May 2019 20:47:20 +0200
+Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test
+
+Test fails on SHM_STAT testcase:
+ shmctl01 5 TFAIL : shmctl01.c:173: shmctl01 call failed
+ errno = 22 : Invalid argument
+ shmctl(0, SHM_STAT, 0x601060) = -EINVAL
+
+since following commit:
+ commit 99db46ea292780cd978d56932d9445b1e8bdafe8
+ Author: Manfred Spraul <manfred@colorfullife.com>
+ Date: Tue May 14 15:46:36 2019 -0700
+ ipc: do cyclic id allocation for the ipc object.
+
+Don't rely on index 0 being always available, but instead
+use (maximum) index returned by SHM_INFO.
+
+Signed-off-by: Jan Stancek <jstancek@redhat.com>
+Reviewed-by: Petr Vorel <pvorel@suse.cz>
+Acked-by: Cyril Hrubis <chrubis@suse.cz>
+
+Upstream-Status: Backport
+[https://github.com/linux-test-project/ltp/commit/db0a43d9388be2c347a8306751bbe6bec086d062]
+
+Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+index 1b46977..52bf23a 100644
+--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
++++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+@@ -79,6 +79,7 @@ static void func_info(int ret);
+
+ /* Check routine for SHM_STAT */
+ static void func_sstat(int ret);
++static void func_sstat_setup(void);
+
+ /* Check routine for SHM_LOCK */
+ static void func_lock(int ret);
+@@ -110,7 +111,7 @@ static struct test_case_t {
+ #endif
+ {&shm_id_1, IPC_SET, &buf, func_set, set_setup},
+ {&shm_id_1, IPC_INFO, (struct shmid_ds *) &info, func_info, NULL},
+- {&shm_index, SHM_STAT, &buf, func_sstat, NULL},
++ {&shm_index, SHM_STAT, &buf, func_sstat, func_sstat_setup},
+ {&shm_id_1, SHM_LOCK, NULL, func_lock, NULL},
+ {&shm_id_1, SHM_UNLOCK, NULL, func_unlock, NULL},
+ {&shm_id_1, IPC_RMID, NULL, func_rmid, NULL},
+@@ -407,9 +408,23 @@ static void func_info(int ret)
+ static void func_sstat(int ret)
+ {
+ if (ret >= 0)
+- tst_resm(TPASS, "get correct shared memory id");
++ tst_resm(TPASS, "get correct shared memory id for index: %d",
++ shm_index);
+ else
+- tst_resm(TFAIL, "shared memory id is incorrect");
++ tst_resm(TFAIL, "shared memory id is incorrect, index: %d",
++ shm_index);
++}
++
++static void func_sstat_setup(void)
++{
++ struct shm_info tmp;
++ int ret;
++
++ ret = shmctl(shm_id_1, SHM_INFO, (void *)&tmp);
++ if (ret < 0)
++ tst_resm(TFAIL|TERRNO, "shmctl(SHM_INFO)");
++ else
++ shm_index = ret;
+ }
+
+ static void func_lock(int ret)
+--
+2.7.4
+