[oe-commits] [openembedded-core] 03/18: ltp: recent glibc calls syscall directly

git at git.openembedded.org git at git.openembedded.org
Mon Oct 8 15:12:03 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e8b83c4759e5b9d8a042d6d531e1e84c06f4691f
Author: Hongzhi.Song <hongzhi.song at windriver.com>
AuthorDate: Sun Oct 7 20:31:51 2018 -0700

    ltp: recent glibc calls syscall directly
    
    The case of sigwaitinfo related to sigwaitinfo API failed.
    
    glibc commit
      8b0e795aaa44 ("Simplify Linux sig{timed}wait{info} implementations")
      changed sigwaitinfo to call sigtimedwait, which calls rt_sigtimedwait
      syscall directly.
    
    So, an invalid pointer no longer crashes child process and test
    reports failure. Fix it by accepting either crash or EFAULT.
    
    Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...nfo01-recent-glibc-calls-syscall-directly.patch | 75 ++++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20180515.bb          |  1 +
 2 files changed, 76 insertions(+)

diff --git a/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch b/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch
new file mode 100644
index 0000000..c412c89
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch
@@ -0,0 +1,75 @@
+From bb977ca0716ae98f10102c7122fe15bc0ddb5356 Mon Sep 17 00:00:00 2001
+From: "Hongzhi.Song" <hongzhi.song at windriver.com>
+Date: Thu, 20 Sep 2018 21:49:02 -0400
+Subject: [PATCH] sigwaitinfo01: recent glibc calls syscall directly
+
+glibc commit
+  8b0e795aaa44 ("Simplify Linux sig{timed}wait{info} implementations")
+changed sigwaitinfo to call sigtimedwait, which calls rt_sigtimedwait
+syscall directly.
+
+So, an invalid pointer no longer crashes child process and test
+reports failure. Fix it by accepting either crash or EFAULT.
+
+Signed-off-by: Jan Stancek <jstancek at redhat.com>
+
+Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-September/009338.html]
+
+Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
+---
+ .../kernel/syscalls/sigwaitinfo/sigwaitinfo01.c    | 30 +++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 4 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
+index 95a9436a4..8fa8ac34b 100644
+--- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
++++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
+@@ -371,19 +371,41 @@ void test_bad_address2(swi_func sigwaitinfo, int signo)
+ 		tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
+ 	case 0:
+ 		signal(SIGSEGV, SIG_DFL);
++
++       /*
++        * depending on glibc implementation we should
++        * either crash or get EFAULT
++        */
+ 		TEST(sigwaitinfo((void *)1, NULL, NULL));
+ 
+-		_exit(0);
++       if (TEST_RETURN == -1 && TEST_ERRNO == EFAULT)
++           _exit(0);
++
++       tst_resm(TINFO, "swi_func returned: %ld, errno: %d",
++           TEST_RETURN, TEST_ERRNO);
++       _exit(1);
++
+ 		break;
+ 	default:
+ 		break;
+ 	}
+ 
+ 	SUCCEED_OR_DIE(waitpid, "waitpid failed", pid, &status, 0);
+-	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
++
++   if ((WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
++       || (WIFEXITED(status) && WEXITSTATUS(status) == 0)) {
+ 		tst_resm(TPASS, "Test passed");
+-	else
+-		tst_resm(TFAIL, "Unrecognised child exit code");
++       return;
++   }
++
++   if (WIFEXITED(status)) {
++       tst_resm(TFAIL, "Unrecognised child exit code: %d",
++           WEXITSTATUS(status));
++   }
++   if (WIFSIGNALED(status)) {
++       tst_resm(TFAIL, "Unrecognised child termsig: %d",
++           WTERMSIG(status));
++   }
+ }
+ 
+ void test_bad_address3(swi_func sigwaitinfo, int signo)
+-- 
+2.11.0
+
diff --git a/meta/recipes-extended/ltp/ltp_20180515.bb b/meta/recipes-extended/ltp/ltp_20180515.bb
index ce86f7f..ba0e6a6 100644
--- a/meta/recipes-extended/ltp/ltp_20180515.bb
+++ b/meta/recipes-extended/ltp/ltp_20180515.bb
@@ -53,6 +53,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch \
            file://0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch \
            file://0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch \
+           file://0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch \
            "
 
 S = "${WORKDIR}/git"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list