diff options
6 files changed, 115 insertions, 285 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-dirtyc0w-Include-stdint.h.patch b/meta/recipes-extended/ltp/ltp/0001-dirtyc0w-Include-stdint.h.patch deleted file mode 100644 index 5c73be440b..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-dirtyc0w-Include-stdint.h.patch +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | From 1b30d8dac1a37dc0abbb3b545db2824d6489e23f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 9 Jun 2017 09:32:13 -0700 | ||
| 4 | Subject: [PATCH] dirtyc0w: Include stdint.h | ||
| 5 | |||
| 6 | uintptr_t is defined in stdint.h | ||
| 7 | |||
| 8 | Fixes | ||
| 9 | | dirtyc0w_child.c:76:15: error: 'uintptr_t' undeclared (first use in this function); did you mean 'intptr_t'? | ||
| 10 | | lseek(mfd, (uintptr_t) map, SEEK_SET); | ||
| 11 | | ^~~~~~~~~ | ||
| 12 | |||
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 14 | --- | ||
| 15 | Upstream-Status: Submitted | ||
| 16 | |||
| 17 | testcases/kernel/security/dirtyc0w/dirtyc0w_child.c | 1 + | ||
| 18 | 1 file changed, 1 insertion(+) | ||
| 19 | |||
| 20 | diff --git a/testcases/kernel/security/dirtyc0w/dirtyc0w_child.c b/testcases/kernel/security/dirtyc0w/dirtyc0w_child.c | ||
| 21 | index 5328a9bc4..49abdd6ba 100644 | ||
| 22 | --- a/testcases/kernel/security/dirtyc0w/dirtyc0w_child.c | ||
| 23 | +++ b/testcases/kernel/security/dirtyc0w/dirtyc0w_child.c | ||
| 24 | @@ -23,6 +23,7 @@ | ||
| 25 | #include <sys/stat.h> | ||
| 26 | #include <string.h> | ||
| 27 | #include <stdlib.h> | ||
| 28 | +#include <stdint.h> | ||
| 29 | #include <pwd.h> | ||
| 30 | |||
| 31 | #include "tst_safe_pthread.h" | ||
| 32 | -- | ||
| 33 | 2.13.1 | ||
| 34 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch b/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch deleted file mode 100644 index 020ddfe3bf..0000000000 --- a/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From b906ec2fe4711a727e198cd9259287c042eef8e2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dengke Du <dengke.du@windriver.com> | ||
| 3 | Date: Thu, 9 Feb 2017 16:41:12 +0800 | ||
| 4 | Subject: [PATCH] fix PATH_MAX undeclared when building with musl | ||
| 5 | |||
| 6 | fix PATH_MAX undeclared when building with musl. | ||
| 7 | |||
| 8 | Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/176] | ||
| 9 | |||
| 10 | Signed-off-by: Dengke Du <dengke.du@windriver.com> | ||
| 11 | --- | ||
| 12 | include/tst_test.h | 3 +++ | ||
| 13 | 1 file changed, 3 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/include/tst_test.h b/include/tst_test.h | ||
| 16 | index 335c82684..4dfa1511b 100644 | ||
| 17 | --- a/include/tst_test.h | ||
| 18 | +++ b/include/tst_test.h | ||
| 19 | @@ -23,6 +23,9 @@ | ||
| 20 | #endif /* __TEST_H__ */ | ||
| 21 | |||
| 22 | #include <unistd.h> | ||
| 23 | +#ifndef __GLIBC__ | ||
| 24 | +#include <limits.h> | ||
| 25 | +#endif | ||
| 26 | |||
| 27 | #include "tst_common.h" | ||
| 28 | #include "tst_res_flags.h" | ||
| 29 | -- | ||
| 30 | 2.11.0 | ||
| 31 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch b/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch deleted file mode 100644 index 99497d655a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | From 4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Naresh Kamboju <naresh.kamboju@linaro.org> | ||
| 3 | Date: Mon, 19 Jun 2017 19:01:21 +0530 | ||
| 4 | Subject: [PATCH 1/7] faccessat and fchmodat: Fix build warnings | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Fixing below build warnings. | ||
| 10 | |||
| 11 | ltp-full-20170516/testcases/kernel/syscalls/faccessat$ make | ||
| 12 | In file included from ../../../../include/old/test.h:51:0, | ||
| 13 | from faccessat01.c:44: | ||
| 14 | faccessat01.c: In function ‘setup’: | ||
| 15 | ../../../../include/old/old_safe_file_ops.h:55:27: | ||
| 16 | warning: format not a string literal and no format arguments [-Wformat-security] | ||
| 17 | (path), (fmt), ## __VA_ARGS__) | ||
| 18 | ^ | ||
| 19 | faccessat01.c:132:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’ | ||
| 20 | SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 21 | ^ | ||
| 22 | ../../../../include/old/old_safe_file_ops.h:55:27: | ||
| 23 | warning: format not a string literal and no format arguments [-Wformat-security] | ||
| 24 | (path), (fmt), ## __VA_ARGS__) | ||
| 25 | ^ | ||
| 26 | faccessat01.c:133:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’ | ||
| 27 | SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 28 | |||
| 29 | Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> | ||
| 30 | Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647] | ||
| 31 | --- | ||
| 32 | testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++-- | ||
| 33 | testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++-- | ||
| 34 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 37 | index 622dfd3b0..def7fa755 100644 | ||
| 38 | --- a/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 39 | +++ b/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 40 | @@ -129,8 +129,8 @@ void setup(void) | ||
| 41 | fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); | ||
| 42 | fds[1] = fds[4] = fds[0]; | ||
| 43 | |||
| 44 | - SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 45 | - SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 46 | + SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile); | ||
| 47 | + SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2); | ||
| 48 | |||
| 49 | fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); | ||
| 50 | |||
| 51 | diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 52 | index 6bf66d8b8..7856ed3fa 100644 | ||
| 53 | --- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 54 | +++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 55 | @@ -127,8 +127,8 @@ void setup(void) | ||
| 56 | fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); | ||
| 57 | fds[1] = fds[4] = fds[0]; | ||
| 58 | |||
| 59 | - SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 60 | - SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 61 | + SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile); | ||
| 62 | + SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2); | ||
| 63 | |||
| 64 | fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); | ||
| 65 | fds[3] = 100; | ||
| 66 | -- | ||
| 67 | 2.13.0 | ||
| 68 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch new file mode 100644 index 0000000000..c8738ae0d4 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | From a9d5595d2fa2ab252f1cabf63f4b65c3efbafeb9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dengke Du <dengke.du@windriver.com> | ||
| 3 | Date: Thu, 10 Aug 2017 15:27:03 +0800 | ||
| 4 | Subject: [PATCH] ltp: fix PAGE_SIZE redefinition and O_CREAT undeclear when | ||
| 5 | build with musl | ||
| 6 | |||
| 7 | error 1: | ||
| 8 | |||
| 9 | |stack_clash.c:50:22: error: expected identifier or '(' before numeric constant | ||
| 10 | | static unsigned long PAGE_SIZE; | ||
| 11 | |||
| 12 | This is because the musl libc already contain PAGE_SIZE definition in limits.c, | ||
| 13 | we can check it here: | ||
| 14 | |||
| 15 | https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n43 | ||
| 16 | |||
| 17 | error 2: | ||
| 18 | |||
| 19 | |ck01.c:157:22: error: 'O_CREAT' undeclared (first use in this function); did you mean 'S_IREAD'? | ||
| 20 | | fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0644); | ||
| 21 | | ^~~~~~~ | ||
| 22 | | S_IREAD | ||
| 23 | |||
| 24 | This is because the musl libc put those in fcntl.h, so we should include that | ||
| 25 | file. | ||
| 26 | |||
| 27 | Upstream-Status: Submitted [ https://github.com/linux-test-project/ltp/pull/194 ] | ||
| 28 | |||
| 29 | Signed-off-by: Dengke Du <dengke.du@windriver.com> | ||
| 30 | --- | ||
| 31 | testcases/cve/stack_clash.c | 12 ++++++------ | ||
| 32 | testcases/kernel/syscalls/flock/flock01.c | 1 + | ||
| 33 | testcases/kernel/syscalls/flock/flock02.c | 1 + | ||
| 34 | 3 files changed, 8 insertions(+), 6 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c | ||
| 37 | index 2ef1a82..7c45991 100644 | ||
| 38 | --- a/testcases/cve/stack_clash.c | ||
| 39 | +++ b/testcases/cve/stack_clash.c | ||
| 40 | @@ -47,7 +47,7 @@ | ||
| 41 | #include "tst_test.h" | ||
| 42 | #include "tst_safe_stdio.h" | ||
| 43 | |||
| 44 | -static unsigned long PAGE_SIZE; | ||
| 45 | +static unsigned long PAGE_SIZE_tst; | ||
| 46 | static unsigned long PAGE_MASK; | ||
| 47 | static unsigned long GAP_PAGES = 256; | ||
| 48 | static unsigned long THRESHOLD; | ||
| 49 | @@ -66,7 +66,7 @@ void exhaust_stack_into_sigsegv(void) | ||
| 50 | exhaust_stack_into_sigsegv(); | ||
| 51 | } | ||
| 52 | |||
| 53 | -#define MAPPED_LEN PAGE_SIZE | ||
| 54 | +#define MAPPED_LEN PAGE_SIZE_tst | ||
| 55 | static unsigned long mapped_addr; | ||
| 56 | |||
| 57 | void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED) | ||
| 58 | @@ -150,7 +150,7 @@ void do_child(void) | ||
| 59 | stack_t signal_stack; | ||
| 60 | struct sigaction segv_sig = {.sa_sigaction = segv_handler, .sa_flags = SA_ONSTACK|SA_SIGINFO}; | ||
| 61 | void *map; | ||
| 62 | - unsigned long gap = GAP_PAGES * PAGE_SIZE; | ||
| 63 | + unsigned long gap = GAP_PAGES * PAGE_SIZE_tst; | ||
| 64 | struct rlimit rlimit; | ||
| 65 | |||
| 66 | rlimit.rlim_cur = rlimit.rlim_max = RLIM_INFINITY; | ||
| 67 | @@ -200,8 +200,8 @@ void setup(void) | ||
| 68 | { | ||
| 69 | char buf[4096], *p; | ||
| 70 | |||
| 71 | - PAGE_SIZE = sysconf(_SC_PAGESIZE); | ||
| 72 | - PAGE_MASK = ~(PAGE_SIZE - 1); | ||
| 73 | + PAGE_SIZE_tst = sysconf(_SC_PAGESIZE); | ||
| 74 | + PAGE_MASK = ~(PAGE_SIZE_tst - 1); | ||
| 75 | |||
| 76 | buf[4095] = '\0'; | ||
| 77 | SAFE_FILE_SCANF("/proc/cmdline", "%4095[^\n]", buf); | ||
| 78 | @@ -214,7 +214,7 @@ void setup(void) | ||
| 79 | tst_res(TINFO, "stack_guard_gap = %ld", GAP_PAGES); | ||
| 80 | } | ||
| 81 | |||
| 82 | - THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE; | ||
| 83 | + THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE_tst; | ||
| 84 | |||
| 85 | { | ||
| 86 | volatile int *a = alloca(128); | ||
| 87 | diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c | ||
| 88 | index 3e17be4..06d89e3 100644 | ||
| 89 | --- a/testcases/kernel/syscalls/flock/flock01.c | ||
| 90 | +++ b/testcases/kernel/syscalls/flock/flock01.c | ||
| 91 | @@ -69,6 +69,7 @@ | ||
| 92 | #include <stdio.h> | ||
| 93 | #include <sys/wait.h> | ||
| 94 | #include <sys/file.h> | ||
| 95 | +#include <fcntl.h> | ||
| 96 | #include "test.h" | ||
| 97 | |||
| 98 | void setup(void); | ||
| 99 | diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c | ||
| 100 | index 414df68..9ddf729 100644 | ||
| 101 | --- a/testcases/kernel/syscalls/flock/flock02.c | ||
| 102 | +++ b/testcases/kernel/syscalls/flock/flock02.c | ||
| 103 | @@ -75,6 +75,7 @@ | ||
| 104 | #include <sys/types.h> | ||
| 105 | #include <sys/file.h> | ||
| 106 | #include <sys/wait.h> | ||
| 107 | +#include <fcntl.h> | ||
| 108 | #include <errno.h> | ||
| 109 | #include <stdio.h> | ||
| 110 | #include "test.h" | ||
| 111 | -- | ||
| 112 | 2.7.4 | ||
| 113 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0038-syscalls-add_key02-update-to-test-fix-for-nonempty-N.patch b/meta/recipes-extended/ltp/ltp/0038-syscalls-add_key02-update-to-test-fix-for-nonempty-N.patch deleted file mode 100644 index 3759e1fa9f..0000000000 --- a/meta/recipes-extended/ltp/ltp/0038-syscalls-add_key02-update-to-test-fix-for-nonempty-N.patch +++ /dev/null | |||
| @@ -1,136 +0,0 @@ | |||
| 1 | From 25045624e941ee76a13febd36187e23c6c435507 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Eric Biggers <ebiggers@google.com> | ||
| 3 | Date: Mon, 12 Jun 2017 11:55:21 -0700 | ||
| 4 | Subject: [PATCH 01/39] syscalls/add_key02: update to test fix for nonempty | ||
| 5 | NULL payload | ||
| 6 | |||
| 7 | add_key02 was supposed to be a "Basic test for the add_key() syscall", | ||
| 8 | but it actually happened to test the obscure case of passing a NULL | ||
| 9 | payload with nonzero length. This case was mishandled by the kernel, | ||
| 10 | which either returned EINVAL or crashed with a NULL pointer dereference, | ||
| 11 | depending on the key type. (The former applied to the test, as it used | ||
| 12 | the "user" key type.) The expected behavior in this case is that the | ||
| 13 | syscall fail with EFAULT. | ||
| 14 | |||
| 15 | Update the test to expect the fixed behavior from v4.12-rc5, and make | ||
| 16 | the test more thorough by testing additional key types, including ones | ||
| 17 | that caused a NULL pointer dereference in unfixed kernels. | ||
| 18 | |||
| 19 | Signed-off-by: Eric Biggers <ebiggers@google.com> | ||
| 20 | Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/25045624e941ee76a13febd36187e23c6c435507] | ||
| 21 | --- | ||
| 22 | testcases/kernel/syscalls/add_key/add_key02.c | 69 ++++++++++++++++++++------- | ||
| 23 | 1 file changed, 51 insertions(+), 18 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/testcases/kernel/syscalls/add_key/add_key02.c b/testcases/kernel/syscalls/add_key/add_key02.c | ||
| 26 | index 866800d6f..2e3308dcd 100644 | ||
| 27 | --- a/testcases/kernel/syscalls/add_key/add_key02.c | ||
| 28 | +++ b/testcases/kernel/syscalls/add_key/add_key02.c | ||
| 29 | @@ -1,5 +1,6 @@ | ||
| 30 | /****************************************************************************** | ||
| 31 | * Copyright (c) Crackerjack Project., 2007 * | ||
| 32 | + * Copyright (c) 2017 Google, Inc. * | ||
| 33 | * * | ||
| 34 | * This program is free software; you can redistribute it and/or modify * | ||
| 35 | * it under the terms of the GNU General Public License as published by * | ||
| 36 | @@ -18,10 +19,17 @@ | ||
| 37 | ******************************************************************************/ | ||
| 38 | |||
| 39 | /* | ||
| 40 | - * Basic test for the add_key() syscall. | ||
| 41 | + * Test that the add_key() syscall correctly handles a NULL payload with nonzero | ||
| 42 | + * length. Specifically, it should fail with EFAULT rather than oopsing the | ||
| 43 | + * kernel with a NULL pointer dereference or failing with EINVAL, as it did | ||
| 44 | + * before (depending on the key type). This is a regression test for commit | ||
| 45 | + * 5649645d725c ("KEYS: fix dereferencing NULL payload with nonzero length"). | ||
| 46 | * | ||
| 47 | - * History: Porting from Crackerjack to LTP is done by | ||
| 48 | - * Manas Kumar Nayak maknayak@in.ibm.com> | ||
| 49 | + * Note that none of the key types that exhibited the NULL pointer dereference | ||
| 50 | + * are guaranteed to be built into the kernel, so we just test as many as we | ||
| 51 | + * can, in the hope of catching one. We also test with the "user" key type for | ||
| 52 | + * good measure, although it was one of the types that failed with EINVAL rather | ||
| 53 | + * than dereferencing NULL. | ||
| 54 | */ | ||
| 55 | |||
| 56 | #include "config.h" | ||
| 57 | @@ -33,36 +41,61 @@ | ||
| 58 | |||
| 59 | #ifdef HAVE_LINUX_KEYCTL_H | ||
| 60 | struct tcase { | ||
| 61 | - char *type; | ||
| 62 | - char *desc; | ||
| 63 | - void *payload; | ||
| 64 | - int plen; | ||
| 65 | - int exp_errno; | ||
| 66 | + const char *type; | ||
| 67 | + size_t plen; | ||
| 68 | } tcases[] = { | ||
| 69 | - {"user", "firstkey", NULL, 1, EINVAL} | ||
| 70 | + /* | ||
| 71 | + * The payload length we test for each key type needs to pass initial | ||
| 72 | + * validation but is otherwise arbitrary. Note: the "rxrpc_s" key type | ||
| 73 | + * requires a payload of exactly 8 bytes. | ||
| 74 | + */ | ||
| 75 | + { "asymmetric", 64 }, | ||
| 76 | + { "cifs.idmap", 64 }, | ||
| 77 | + { "cifs.spnego", 64 }, | ||
| 78 | + { "pkcs7_test", 64 }, | ||
| 79 | + { "rxrpc", 64 }, | ||
| 80 | + { "rxrpc_s", 8 }, | ||
| 81 | + { "user", 64 }, | ||
| 82 | }; | ||
| 83 | #endif /* HAVE_LINUX_KEYCTL_H */ | ||
| 84 | |||
| 85 | static void verify_add_key(unsigned int i) | ||
| 86 | { | ||
| 87 | #ifdef HAVE_LINUX_KEYCTL_H | ||
| 88 | - TEST(tst_syscall(__NR_add_key, tcases[i].type, tcases[i].desc, | ||
| 89 | - tcases[i].payload, tcases[i].plen, | ||
| 90 | - KEY_SPEC_USER_KEYRING)); | ||
| 91 | + TEST(tst_syscall(__NR_add_key, tcases[i].type, "abc:def", | ||
| 92 | + NULL, tcases[i].plen, KEY_SPEC_PROCESS_KEYRING)); | ||
| 93 | |||
| 94 | if (TEST_RETURN != -1) { | ||
| 95 | - tst_res(TFAIL, "add_key() passed unexpectedly"); | ||
| 96 | + tst_res(TFAIL, | ||
| 97 | + "add_key() with key type '%s' unexpectedly succeeded", | ||
| 98 | + tcases[i].type); | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 102 | - if (TEST_ERRNO == tcases[i].exp_errno) { | ||
| 103 | - tst_res(TPASS | TTERRNO, "add_key() failed expectedly"); | ||
| 104 | + if (TEST_ERRNO == EFAULT) { | ||
| 105 | + tst_res(TPASS, "received expected EFAULT with key type '%s'", | ||
| 106 | + tcases[i].type); | ||
| 107 | return; | ||
| 108 | } | ||
| 109 | |||
| 110 | - tst_res(TFAIL | TTERRNO, | ||
| 111 | - "add_key() failed unexpectedly, expected %s", | ||
| 112 | - tst_strerrno(tcases[i].exp_errno)); | ||
| 113 | + if (TEST_ERRNO == ENODEV) { | ||
| 114 | + tst_res(TCONF, "kernel doesn't support key type '%s'", | ||
| 115 | + tcases[i].type); | ||
| 116 | + return; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + /* | ||
| 120 | + * It's possible for the "asymmetric" key type to be supported, but with | ||
| 121 | + * no asymmetric key parsers registered. In that case, attempting to | ||
| 122 | + * add a key of type asymmetric will fail with EBADMSG. | ||
| 123 | + */ | ||
| 124 | + if (TEST_ERRNO == EBADMSG && !strcmp(tcases[i].type, "asymmetric")) { | ||
| 125 | + tst_res(TCONF, "no asymmetric key parsers are registered"); | ||
| 126 | + return; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + tst_res(TFAIL | TTERRNO, "unexpected error with key type '%s'", | ||
| 130 | + tcases[i].type); | ||
| 131 | #else | ||
| 132 | tst_brk(TCONF, "linux/keyctl.h was missing upon compilation."); | ||
| 133 | #endif /* HAVE_LINUX_KEYCTL_H */ | ||
| 134 | -- | ||
| 135 | 2.13.0 | ||
| 136 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20170516.bb b/meta/recipes-extended/ltp/ltp_20170516.bb index 86b801288d..665e08f204 100644 --- a/meta/recipes-extended/ltp/ltp_20170516.bb +++ b/meta/recipes-extended/ltp/ltp_20170516.bb | |||
| @@ -21,7 +21,7 @@ DEPENDS_append_libc-musl = " fts " | |||
| 21 | EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " | 21 | EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " |
| 22 | CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" | 22 | CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" |
| 23 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" | 23 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" |
| 24 | SRCREV = "6c6c6ca40afb3611e52486f670085762ff451e91" | 24 | SRCREV = "18916a2e6d8c997b7b29dcfa9550d5a15b22ed22" |
| 25 | 25 | ||
| 26 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ | 26 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ |
| 27 | file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \ | 27 | file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \ |
| @@ -29,7 +29,6 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 29 | file://0003-Add-knob-to-control-tirpc-support.patch \ | 29 | file://0003-Add-knob-to-control-tirpc-support.patch \ |
| 30 | file://0004-build-Add-option-to-select-libc-implementation.patch \ | 30 | file://0004-build-Add-option-to-select-libc-implementation.patch \ |
| 31 | file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ | 31 | file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ |
| 32 | file://0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch \ | ||
| 33 | file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \ | 32 | file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \ |
| 34 | file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ | 33 | file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ |
| 35 | file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ | 34 | file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ |
| @@ -49,9 +48,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 49 | file://0034-periodic_output.patch \ | 48 | file://0034-periodic_output.patch \ |
| 50 | file://0035-fix-test_proc_kill-hang.patch \ | 49 | file://0035-fix-test_proc_kill-hang.patch \ |
| 51 | file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ | 50 | file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ |
| 52 | file://0001-dirtyc0w-Include-stdint.h.patch \ | 51 | file://0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch \ |
| 53 | file://0037-faccessat-and-fchmodat-Fix-build-warnings.patch \ | ||
| 54 | file://0038-syscalls-add_key02-update-to-test-fix-for-nonempty-N.patch \ | ||
| 55 | " | 52 | " |
| 56 | 53 | ||
| 57 | S = "${WORKDIR}/git" | 54 | S = "${WORKDIR}/git" |
| @@ -69,14 +66,6 @@ EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite " | |||
| 69 | # ltp network/rpc test cases ftbfs when libtirpc is found | 66 | # ltp network/rpc test cases ftbfs when libtirpc is found |
| 70 | EXTRA_OECONF += " --without-tirpc " | 67 | EXTRA_OECONF += " --without-tirpc " |
| 71 | 68 | ||
| 72 | # The makefiles make excessive use of make -C and several include testcases.mk | ||
| 73 | # which triggers a build of the syscall header. To reproduce, build ltp, | ||
| 74 | # then delete the header, then "make -j XX" and watch regen.sh run multiple | ||
| 75 | # times. Its easier to generate this once here instead. | ||
| 76 | do_compile_prepend () { | ||
| 77 | ( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h ) | ||
| 78 | } | ||
| 79 | |||
| 80 | do_install(){ | 69 | do_install(){ |
| 81 | install -d ${D}/opt/ltp/ | 70 | install -d ${D}/opt/ltp/ |
| 82 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install | 71 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install |
| @@ -89,9 +78,6 @@ do_install(){ | |||
| 89 | # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible | 78 | # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible |
| 90 | rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl | 79 | rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl |
| 91 | 80 | ||
| 92 | # In oe-core, we doesn't support ksh and csh now, so remove in.csh and in.ksh. | ||
| 93 | rm ${D}/opt/ltp/testcases/data/file01/in.csh | ||
| 94 | rm ${D}/opt/ltp/testcases/data/file01/in.ksh | ||
| 95 | # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual | 81 | # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual |
| 96 | cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases | 82 | cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases |
| 97 | } | 83 | } |
