diff mbox series

[v3] ltp: fix fanotify06 test

Message ID 20180213115748.3135-1-anders.roxell@linaro.org
State Accepted
Commit 514ffed6a2d42f0a1c40c906e7502cfd7e590a0f
Headers show
Series [v3] ltp: fix fanotify06 test | expand

Commit Message

Anders Roxell Feb. 13, 2018, 11:57 a.m. UTC
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

---
 ...-make-is_fuse-return-zero-if-fs_type-is-N.patch | 40 ++++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20180118.bb          |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Maxin B. John Feb. 13, 2018, 12:34 p.m. UTC | #1
Tested-by: Maxin B. John <maxin.john@intel.com>


On Tue, Feb 13, 2018 at 12:57:48PM +0100, Anders Roxell wrote:
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> ---

>  ...-make-is_fuse-return-zero-if-fs_type-is-N.patch | 40 ++++++++++++++++++++++

>  meta/recipes-extended/ltp/ltp_20180118.bb          |  1 +

>  2 files changed, 41 insertions(+)

>  create mode 100644 meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch

> 

> diff --git a/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch b/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch

> new file mode 100644

> index 0000000000..5096a85c1e

> --- /dev/null

> +++ b/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch

> @@ -0,0 +1,40 @@

> +From 67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d Mon Sep 17 00:00:00 2001

> +From: Li Wang <liwang@redhat.com>

> +Date: Tue, 23 Jan 2018 17:46:35 +0800

> +Subject: [PATCH] safe_macros: make is_fuse() return zero if fs_type is NULL

> +

> +This commmit 28507e514c(safe_mount: Do not try mount() syscall for FUSE fs)

> +involves FUSE fs check in safe_mount(), but we'd better guarantee the "fs_type"

> +is legal to check in is_fuse() function otherwise system will kill the program.

> +

> +  cmdline="fanotify06"

> +  contacts=""

> +  analysis=exit

> +  <<<test_output>>>

> +  tst_test.c:980: INFO: Timeout per run is 0h 10m 00s

> +  tst_test.c:1025: BROK: Test killed by SIGSEGV!

> +

> +Signed-off-by: Li Wang <liwang@redhat.com>

> +Acked-by: Jan Stancek <jstancek@redhat.com>

> +Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d]

> +---

> + lib/safe_macros.c | 3 +++

> + 1 file changed, 3 insertions(+)

> +

> +diff --git a/lib/safe_macros.c b/lib/safe_macros.c

> +index c48e436dc..abdeca013 100644

> +--- a/lib/safe_macros.c

> ++++ b/lib/safe_macros.c

> +@@ -708,6 +708,9 @@ static int is_fuse(const char *fs_type)

> + {

> + 	unsigned int i;

> + 

> ++	if (!fs_type)

> ++		return 0;

> ++

> + 	for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) {

> + 		if (!strcmp(fuse_fs_types[i], fs_type))

> + 			return 1;

> +-- 

> +2.11.0

> +

> diff --git a/meta/recipes-extended/ltp/ltp_20180118.bb b/meta/recipes-extended/ltp/ltp_20180118.bb

> index 369b98df9b..b7cac8592a 100644

> --- a/meta/recipes-extended/ltp/ltp_20180118.bb

> +++ b/meta/recipes-extended/ltp/ltp_20180118.bb

> @@ -43,6 +43,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \

>             file://0035-fix-test_proc_kill-hang.patch \

>             file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \

>             file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \

> +           file://0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch \

>             "

>  

>  S = "${WORKDIR}/git"

> -- 

> 2.11.0

> 

> -- 

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch b/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
new file mode 100644
index 0000000000..5096a85c1e
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
@@ -0,0 +1,40 @@ 
+From 67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d Mon Sep 17 00:00:00 2001
+From: Li Wang <liwang@redhat.com>
+Date: Tue, 23 Jan 2018 17:46:35 +0800
+Subject: [PATCH] safe_macros: make is_fuse() return zero if fs_type is NULL
+
+This commmit 28507e514c(safe_mount: Do not try mount() syscall for FUSE fs)
+involves FUSE fs check in safe_mount(), but we'd better guarantee the "fs_type"
+is legal to check in is_fuse() function otherwise system will kill the program.
+
+  cmdline="fanotify06"
+  contacts=""
+  analysis=exit
+  <<<test_output>>>
+  tst_test.c:980: INFO: Timeout per run is 0h 10m 00s
+  tst_test.c:1025: BROK: Test killed by SIGSEGV!
+
+Signed-off-by: Li Wang <liwang@redhat.com>
+Acked-by: Jan Stancek <jstancek@redhat.com>
+Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d]
+---
+ lib/safe_macros.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/safe_macros.c b/lib/safe_macros.c
+index c48e436dc..abdeca013 100644
+--- a/lib/safe_macros.c
++++ b/lib/safe_macros.c
+@@ -708,6 +708,9 @@ static int is_fuse(const char *fs_type)
+ {
+ 	unsigned int i;
+ 
++	if (!fs_type)
++		return 0;
++
+ 	for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) {
+ 		if (!strcmp(fuse_fs_types[i], fs_type))
+ 			return 1;
+-- 
+2.11.0
+
diff --git a/meta/recipes-extended/ltp/ltp_20180118.bb b/meta/recipes-extended/ltp/ltp_20180118.bb
index 369b98df9b..b7cac8592a 100644
--- a/meta/recipes-extended/ltp/ltp_20180118.bb
+++ b/meta/recipes-extended/ltp/ltp_20180118.bb
@@ -43,6 +43,7 @@  SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0035-fix-test_proc_kill-hang.patch \
            file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
            file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \
+           file://0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch \
            "
 
 S = "${WORKDIR}/git"