diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2016-12-12 13:59:46 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-17 09:57:03 +0000 |
commit | 54445dec1cf0c57aa21c9774016b72574d02d11f (patch) | |
tree | 1bc2f16594beaa58e28aeedd6256bab3407497b3 | |
parent | 0fe7a940e23c833e6c07eac4dba7470aa4b1edb8 (diff) | |
download | poky-54445dec1cf0c57aa21c9774016b72574d02d11f.tar.gz |
ltp: avoid segmentation fault in netns tests
* backport a patch to avoid segmentation
fault in netns tests.
* rename previous patch to have ordered
prefix number.
(From OE-Core rev: 67f67da5d673ad60d3d3138ba32822679f565267)
(From OE-Core rev: c8f7c26148a926c6e49ab95a18c4702204e57551)
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch (renamed from meta/recipes-extended/ltp/ltp/0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch) | 0 | ||||
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch | 50 | ||||
-rw-r--r-- | meta/recipes-extended/ltp/ltp_20160126.bb | 3 |
3 files changed, 52 insertions, 1 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch index 04532be79e..04532be79e 100644 --- a/meta/recipes-extended/ltp/ltp/0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch +++ b/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch | |||
diff --git a/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch b/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch new file mode 100644 index 0000000000..18d1f727f2 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 193ce739b2a5174269a958b00c3a5590de944e0d Mon Sep 17 00:00:00 2001 | ||
2 | From: Huacai Chen <chenhc@lemote.com> | ||
3 | Date: Thu, 27 Oct 2016 14:45:52 +0800 | ||
4 | Subject: [PATCH] containers/netns_netlink: Avoid segmentation fault | ||
5 | |||
6 | In order to avoid segmentation fault (use NULL as a function pointer), | ||
7 | this patch modify check_netns() by passing a dummy function pointer to | ||
8 | do_clone_unshare_test(). | ||
9 | |||
10 | Signed-off-by: Huacai Chen <chenhc@lemote.com> | ||
11 | Signed-off-by: Cyril Hrubis <chrubis@suse.cz> | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | |||
15 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
16 | --- | ||
17 | testcases/kernel/containers/netns/netns_helper.h | 10 ++++++++-- | ||
18 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/testcases/kernel/containers/netns/netns_helper.h b/testcases/kernel/containers/netns/netns_helper.h | ||
21 | index 2a331ae..7df6dcb 100644 | ||
22 | --- a/testcases/kernel/containers/netns/netns_helper.h | ||
23 | +++ b/testcases/kernel/containers/netns/netns_helper.h | ||
24 | @@ -56,6 +56,12 @@ static void check_iproute(unsigned int spe_ipver) | ||
25 | pclose(ipf); | ||
26 | } | ||
27 | |||
28 | +static int dummy(void *arg) | ||
29 | +{ | ||
30 | + (void) arg; | ||
31 | + return 0; | ||
32 | +} | ||
33 | + | ||
34 | static void check_netns(void) | ||
35 | { | ||
36 | int pid, status; | ||
37 | @@ -64,8 +70,8 @@ static void check_netns(void) | ||
38 | tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWNS (%d) not supported", | ||
39 | CLONE_NEWNS); | ||
40 | |||
41 | - pid = do_clone_unshare_test(T_UNSHARE, CLONE_NEWNET | CLONE_NEWNS, NULL, | ||
42 | - NULL); | ||
43 | + pid = do_clone_unshare_test(T_UNSHARE, CLONE_NEWNET | CLONE_NEWNS, | ||
44 | + dummy, NULL); | ||
45 | if (pid == -1) | ||
46 | tst_brkm(TCONF | TERRNO, NULL, | ||
47 | "unshare syscall smoke test failed"); | ||
48 | -- | ||
49 | 2.7.4 | ||
50 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20160126.bb b/meta/recipes-extended/ltp/ltp_20160126.bb index 7ee84e3557..841302b0ad 100644 --- a/meta/recipes-extended/ltp/ltp_20160126.bb +++ b/meta/recipes-extended/ltp/ltp_20160126.bb | |||
@@ -62,7 +62,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
62 | file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \ | 62 | file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \ |
63 | file://0034-periodic_output.patch \ | 63 | file://0034-periodic_output.patch \ |
64 | file://0035-fix-test_proc_kill-hang.patch \ | 64 | file://0035-fix-test_proc_kill-hang.patch \ |
65 | file://0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ | 65 | file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ |
66 | file://0037-containers-netns_netlink-Avoid-segmentation-fault.patch \ | ||
66 | " | 67 | " |
67 | 68 | ||
68 | S = "${WORKDIR}/git" | 69 | S = "${WORKDIR}/git" |