Skip to contentSkip to conversation

is_fuse: return zore if fs_type is NULL

PATCH New Li Wang 2 participants 2 messages Jan 23, 2018 Library code

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH v2 1/1 is_fuse: return zore 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!

---
 lib/safe_macros.c | 3 +++
 1 file changed, 3 insertions(+)
lib/safe_macros.c +3 -0
index c48e436..abdeca0 100644
@@ -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;
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 1/1 is_fuse: return zore if fs_type is NULL

----- Original Message -----

Quoted 6 lines

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.

Quoted 8 lines

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!

Pushed with small tweak to commit message.

Regards,
Jan