diff options
| -rw-r--r-- | meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch | 75 | ||||
| -rw-r--r-- | meta/recipes-extended/ltp/ltp_20180515.bb | 1 |
2 files changed, 76 insertions, 0 deletions
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 0000000000..c412c89e99 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | From bb977ca0716ae98f10102c7122fe15bc0ddb5356 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Hongzhi.Song" <hongzhi.song@windriver.com> | ||
| 3 | Date: Thu, 20 Sep 2018 21:49:02 -0400 | ||
| 4 | Subject: [PATCH] sigwaitinfo01: recent glibc calls syscall directly | ||
| 5 | |||
| 6 | glibc commit | ||
| 7 | 8b0e795aaa44 ("Simplify Linux sig{timed}wait{info} implementations") | ||
| 8 | changed sigwaitinfo to call sigtimedwait, which calls rt_sigtimedwait | ||
| 9 | syscall directly. | ||
| 10 | |||
| 11 | So, an invalid pointer no longer crashes child process and test | ||
| 12 | reports failure. Fix it by accepting either crash or EFAULT. | ||
| 13 | |||
| 14 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-September/009338.html] | ||
| 17 | |||
| 18 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
| 19 | --- | ||
| 20 | .../kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 30 +++++++++++++++++++--- | ||
| 21 | 1 file changed, 26 insertions(+), 4 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 24 | index 95a9436a4..8fa8ac34b 100644 | ||
| 25 | --- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 26 | +++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | ||
| 27 | @@ -371,19 +371,41 @@ void test_bad_address2(swi_func sigwaitinfo, int signo) | ||
| 28 | tst_brkm(TBROK | TERRNO, NULL, "fork() failed"); | ||
| 29 | case 0: | ||
| 30 | signal(SIGSEGV, SIG_DFL); | ||
| 31 | + | ||
| 32 | + /* | ||
| 33 | + * depending on glibc implementation we should | ||
| 34 | + * either crash or get EFAULT | ||
| 35 | + */ | ||
| 36 | TEST(sigwaitinfo((void *)1, NULL, NULL)); | ||
| 37 | |||
| 38 | - _exit(0); | ||
| 39 | + if (TEST_RETURN == -1 && TEST_ERRNO == EFAULT) | ||
| 40 | + _exit(0); | ||
| 41 | + | ||
| 42 | + tst_resm(TINFO, "swi_func returned: %ld, errno: %d", | ||
| 43 | + TEST_RETURN, TEST_ERRNO); | ||
| 44 | + _exit(1); | ||
| 45 | + | ||
| 46 | break; | ||
| 47 | default: | ||
| 48 | break; | ||
| 49 | } | ||
| 50 | |||
| 51 | SUCCEED_OR_DIE(waitpid, "waitpid failed", pid, &status, 0); | ||
| 52 | - if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) | ||
| 53 | + | ||
| 54 | + if ((WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) | ||
| 55 | + || (WIFEXITED(status) && WEXITSTATUS(status) == 0)) { | ||
| 56 | tst_resm(TPASS, "Test passed"); | ||
| 57 | - else | ||
| 58 | - tst_resm(TFAIL, "Unrecognised child exit code"); | ||
| 59 | + return; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + if (WIFEXITED(status)) { | ||
| 63 | + tst_resm(TFAIL, "Unrecognised child exit code: %d", | ||
| 64 | + WEXITSTATUS(status)); | ||
| 65 | + } | ||
| 66 | + if (WIFSIGNALED(status)) { | ||
| 67 | + tst_resm(TFAIL, "Unrecognised child termsig: %d", | ||
| 68 | + WTERMSIG(status)); | ||
| 69 | + } | ||
| 70 | } | ||
| 71 | |||
| 72 | void test_bad_address3(swi_func sigwaitinfo, int signo) | ||
| 73 | -- | ||
| 74 | 2.11.0 | ||
| 75 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20180515.bb b/meta/recipes-extended/ltp/ltp_20180515.bb index ce86f7f14b..ba0e6a60b4 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 \ | |||
| 53 | file://0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch \ | 53 | file://0042-fs-ftest-ftest06.c-Fix-too-small-name-string-and-rel.patch \ |
| 54 | file://0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch \ | 54 | file://0043-open-creat-skip-S_ISGID-check-on-files-created-by-no.patch \ |
| 55 | file://0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch \ | 55 | file://0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch \ |
| 56 | file://0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch \ | ||
| 56 | " | 57 | " |
| 57 | 58 | ||
| 58 | S = "${WORKDIR}/git" | 59 | S = "${WORKDIR}/git" |
