diff options
| author | Fathi Boudra <fathi.boudra@linaro.org> | 2017-06-20 18:30:54 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 15:52:18 +0100 |
| commit | 9db6fe1d5da212e8fd244f8d7499b3aafd273135 (patch) | |
| tree | cc9cdeb72247b751fe9c2abad260fb00331507d4 | |
| parent | f6eb3edee3ed5b9fb7123325a50bebeba0212f16 (diff) | |
| download | poky-9db6fe1d5da212e8fd244f8d7499b3aafd273135.tar.gz | |
ltp: use upstream patch to fix faccessat/fchmodat build warnings
Use 0037-faccessat-and-fchmodat-Fx-build-warnings.patch instead of
0012-fix-faccessat01.c-build-fails-with-security-flags.patch.
The new patch has been merged upstream and will be available in next LTP
release.
(From OE-Core rev: 3c1d9629ac3b5af47d0f4db09b4eb7e0eb4b0afe)
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 69 insertions, 71 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch b/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch deleted file mode 100644 index 2600bd60d0..0000000000 --- a/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | From 32f563008f95975d26d1c4fcb266c72c56f934be Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dengke Du <dengke.du@windriver.com> | ||
| 3 | Date: Wed, 22 Feb 2017 01:21:55 -0500 | ||
| 4 | Subject: [PATCH] fix faccessat01.c build fails with security flags | ||
| 5 | |||
| 6 | When the distro is poky-lsb, fix the following error: | ||
| 7 | |||
| 8 | | In file included from ../../../../include/old/test.h:47:0, | ||
| 9 | | from faccessat01.c:44: | ||
| 10 | | faccessat01.c: In function 'setup': | ||
| 11 | | ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security] | ||
| 12 | | (path), (fmt), ## __VA_ARGS__) | ||
| 13 | | ^ | ||
| 14 | | faccessat01.c:132:2: note: in expansion of macro 'SAFE_FILE_PRINTF' | ||
| 15 | | SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 16 | | ^~~~~~~~~~~~~~~~ | ||
| 17 | | ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security] | ||
| 18 | | (path), (fmt), ## __VA_ARGS__) | ||
| 19 | | ^ | ||
| 20 | | faccessat01.c:133:2: note: in expansion of macro 'SAFE_FILE_PRINTF' | ||
| 21 | | SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 22 | | ^~~~~~~~~~~~~~~~ | ||
| 23 | |||
| 24 | This is because in macro "SAFE_FILE_PRINTF", its third argument should be a | ||
| 25 | format arguments, but in file faccessat01.c, it passed the same argument to | ||
| 26 | macro "SAFE_FILE_PRINTF", so it results in the fails. It should pass the format | ||
| 27 | string to the third argument. | ||
| 28 | |||
| 29 | The same for file fchmodat01.c. | ||
| 30 | |||
| 31 | Signed-off-by: Dengke Du <dengke.du@windriver.com> | ||
| 32 | Upstream-Status: Pending | ||
| 33 | --- | ||
| 34 | testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++-- | ||
| 35 | testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++-- | ||
| 36 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 37 | |||
| 38 | diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 39 | index 622dfd3..1ca90e9 100644 | ||
| 40 | --- a/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 41 | +++ b/testcases/kernel/syscalls/faccessat/faccessat01.c | ||
| 42 | @@ -129,8 +129,8 @@ void setup(void) | ||
| 43 | fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); | ||
| 44 | fds[1] = fds[4] = fds[0]; | ||
| 45 | |||
| 46 | - SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 47 | - SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 48 | + SAFE_FILE_PRINTF(cleanup, testfile, "faccessattestfile%d.txt"); | ||
| 49 | + SAFE_FILE_PRINTF(cleanup, testfile2, "%s/faccessattestfile%d.txt"); | ||
| 50 | |||
| 51 | fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); | ||
| 52 | |||
| 53 | diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 54 | index 6bf66d8..89d072a 100644 | ||
| 55 | --- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 56 | +++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c | ||
| 57 | @@ -127,8 +127,8 @@ void setup(void) | ||
| 58 | fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); | ||
| 59 | fds[1] = fds[4] = fds[0]; | ||
| 60 | |||
| 61 | - SAFE_FILE_PRINTF(cleanup, testfile, testfile); | ||
| 62 | - SAFE_FILE_PRINTF(cleanup, testfile2, testfile2); | ||
| 63 | + SAFE_FILE_PRINTF(cleanup, testfile, "fchmodattest%d.txt"); | ||
| 64 | + SAFE_FILE_PRINTF(cleanup, testfile2, "%s/fchmodattest%d.txt"); | ||
| 65 | |||
| 66 | fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); | ||
| 67 | fds[3] = 100; | ||
| 68 | -- | ||
| 69 | 2.8.1 | ||
| 70 | |||
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 new file mode 100644 index 0000000000..99497d655a --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 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_20170516.bb b/meta/recipes-extended/ltp/ltp_20170516.bb index 31f339461f..f537d60c15 100644 --- a/meta/recipes-extended/ltp/ltp_20170516.bb +++ b/meta/recipes-extended/ltp/ltp_20170516.bb | |||
| @@ -35,7 +35,6 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 35 | file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ | 35 | file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ |
| 36 | file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \ | 36 | file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \ |
| 37 | file://0011-Rename-sigset-variable-to-sigset1.patch \ | 37 | file://0011-Rename-sigset-variable-to-sigset1.patch \ |
| 38 | file://0012-fix-faccessat01.c-build-fails-with-security-flags.patch \ | ||
| 39 | file://0018-guard-mallocopt-with-__GLIBC__.patch \ | 38 | file://0018-guard-mallocopt-with-__GLIBC__.patch \ |
| 40 | file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ | 39 | file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ |
| 41 | file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ | 40 | file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ |
| @@ -51,6 +50,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 51 | file://0035-fix-test_proc_kill-hang.patch \ | 50 | file://0035-fix-test_proc_kill-hang.patch \ |
| 52 | file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ | 51 | file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ |
| 53 | file://0001-dirtyc0w-Include-stdint.h.patch \ | 52 | file://0001-dirtyc0w-Include-stdint.h.patch \ |
| 53 | file://0037-faccessat-and-fchmodat-Fix-build-warnings.patch \ | ||
| 54 | " | 54 | " |
| 55 | 55 | ||
| 56 | S = "${WORKDIR}/git" | 56 | S = "${WORKDIR}/git" |
