public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] is_fuse: return zore if fs_type is NULL
Date: Tue, 23 Jan 2018 17:46:35 +0800	[thread overview]
Message-ID: <20180123094635.17931-1-liwang@redhat.com> (raw)

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>
---
 lib/safe_macros.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index c48e436..abdeca0 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.9.3


             reply	other threads:[~2018-01-23  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  9:46 Li Wang [this message]
2018-01-23  9:56 ` [LTP] [PATCH v2] is_fuse: return zore if fs_type is NULL Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180123094635.17931-1-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox