summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorXiangyu Chen <xiangyu.chen@windriver.com>2022-09-20 11:07:27 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-28 08:02:11 +0100
commit5385ece02d6de9bbca6542e687011d2366aed50c (patch)
tree706e72be259984ea2b22b951ed0241bc8c2afaa4 /meta/recipes-extended
parent864e65f0f1aafc9dc7bba46a0ea46e10827c8e21 (diff)
downloadpoky-5385ece02d6de9bbca6542e687011d2366aed50c.tar.gz
ltp: Fix pread02 case trigger the glibc overflow detection
Backport a patch to fix the pread02 case trigger the glibc overflow detection. (From OE-Core rev: 2d32385490344db529de7eca33bb0ab9a14e0555) Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-syscalls-pread02-extend-buffer-to-avoid-glibc-overflow-detection.patch58
-rw-r--r--meta/recipes-extended/ltp/ltp_20220121.bb1
2 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-pread02-extend-buffer-to-avoid-glibc-overflow-detection.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-pread02-extend-buffer-to-avoid-glibc-overflow-detection.patch
new file mode 100644
index 0000000000..94dd418f36
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-syscalls-pread02-extend-buffer-to-avoid-glibc-overflow-detection.patch
@@ -0,0 +1,58 @@
1From de988c9b5605a711b306c4203545b8d761875177 Mon Sep 17 00:00:00 2001
2From: Jan Stancek <jstancek@redhat.com>
3Date: Mon, 31 Jan 2022 12:00:46 +0100
4Subject: [PATCH] syscalls/pread02: extend buffer to avoid glibc overflow
5 detection
6
7Test started failing with recent glibc (glibc-2.34.9000-38.fc36),
8which detects that buffer in pread is potentially too small:
9 tst_test.c:1431: TINFO: Timeout per run is 0h 05m 00s
10 *** buffer overflow detected ***: terminated
11 tst_test.c:1484: TBROK: Test killed by SIGIOT/SIGABRT!
12
13(gdb) bt
14 #0 __pthread_kill_implementation at pthread_kill.c:44
15 #1 0x00007ffff7e46f73 in __pthread_kill_internal at pthread_kill.c:78
16 #2 0x00007ffff7df6a36 in __GI_raise at ../sysdeps/posix/raise.c:26
17 #3 0x00007ffff7de082f in __GI_abort () at abort.c:79
18 #4 0x00007ffff7e3b01e in __libc_message at ../sysdeps/posix/libc_fatal.c:155
19 #5 0x00007ffff7ed945a in __GI___fortify_fail at fortify_fail.c:26
20 #6 0x00007ffff7ed7dc6 in __GI___chk_fail () at chk_fail.c:28
21 #7 0x00007ffff7ed8214 in __pread_chk at pread_chk.c:26
22 #8 0x0000000000404d1a in pread at /usr/include/bits/unistd.h:74
23 #9 verify_pread (n=<optimized out>) at pread02.c:44
24 #10 0x000000000040dc19 in run_tests () at tst_test.c:1246
25 #11 testrun () at tst_test.c:1331
26 #12 fork_testrun () at tst_test.c:1462
27 #13 0x000000000040e9a1 in tst_run_tcases
28 #14 0x0000000000404bde in main
29
30Extend it to number of bytes we are trying to read from fd.
31
32Upstream-Status: Backport
33[https://github.com/linux-test-project/ltp/commit/de988c9b5605a711b306c4203545b8d761875177]
34
35Signed-off-by: Jan Stancek <jstancek@redhat.com>
36Acked-by: Petr Vorel <pvorel@suse.cz>
37Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
38Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
39---
40 testcases/kernel/syscalls/pread/pread02.c | 2 +-
41 1 file changed, 1 insertion(+), 1 deletion(-)
42
43diff --git a/testcases/kernel/syscalls/pread/pread02.c b/testcases/kernel/syscalls/pread/pread02.c
44index de2a81fff..fda5fd190 100644
45--- a/testcases/kernel/syscalls/pread/pread02.c
46+++ b/testcases/kernel/syscalls/pread/pread02.c
47@@ -39,7 +39,7 @@ struct test_case_t {
48 static void verify_pread(unsigned int n)
49 {
50 struct test_case_t *tc = &tcases[n];
51- char buf;
52+ char buf[K1];
53
54 TST_EXP_FAIL2(pread(*tc->fd, &buf, tc->nb, tc->offst), tc->exp_errno,
55 "pread(%d, %zu, %ld) %s", *tc->fd, tc->nb, tc->offst, tc->desc);
56--
572.34.1
58
diff --git a/meta/recipes-extended/ltp/ltp_20220121.bb b/meta/recipes-extended/ltp/ltp_20220121.bb
index 8a13dcf9d0..4ae54492f3 100644
--- a/meta/recipes-extended/ltp/ltp_20220121.bb
+++ b/meta/recipes-extended/ltp/ltp_20220121.bb
@@ -28,6 +28,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=ht
28 file://0001-Remove-OOM-tests-from-runtest-mm.patch \ 28 file://0001-Remove-OOM-tests-from-runtest-mm.patch \
29 file://0001-metadata-parse.sh-sort-filelist-for-reproducibility.patch \ 29 file://0001-metadata-parse.sh-sort-filelist-for-reproducibility.patch \
30 file://disable_hanging_tests.patch \ 30 file://disable_hanging_tests.patch \
31 file://0001-syscalls-pread02-extend-buffer-to-avoid-glibc-overflow-detection.patch \
31 " 32 "
32 33
33S = "${WORKDIR}/git" 34S = "${WORKDIR}/git"