[PATCH] Fixes supermount Oopses when mount options are not given

From: Eduardo Pereira Habkost (ehabkost@conectiva.com.br)
Date: Fri Feb 01 2002 - 12:45:08 EST


The following patch fixes two Oopses on supermount.
The first one happens when the dev= option is not given to supermount, iput()
is called after dput(), but iput() is already called by dput().
The other one happens when the fs= option is not given. subfs_mount() doesn't
check if sbi->s_type is NULL.

Regards,

--
Eduardo Pereira Habkost <ehabkost@conectiva.com.br>
http://www.boto.f2s.com
04BE D2EF 5A56 E446 D424  4785 71A4 49EB AC35 9568
----

# ------------------------ diff -urN kernel-2.4.17/linux/fs/supermount/super.c kernel-2.4.17-supermountok/linux/fs/supermount/super.c --- kernel-2.4.17/linux/fs/supermount/super.c Fri Feb 1 14:10:39 2002 +++ kernel-2.4.17-supermountok/linux/fs/supermount/super.c Fri Feb 1 11:56:36 2002 @@ -276,7 +276,7 @@ char **type = types_in_order; - if (strcmp(sbi->s_type, "auto")) + if (sbi->s_type && strcmp(sbi->s_type, "auto")) return subfs_real_mount2 (sb, sbi->s_type); while (*type && retval) { diff -urN kernel-2.4.17/linux/fs/supermount/super_operations.c kernel-2.4.17-supermountok/linux/fs/supermount/super_operations.c --- kernel-2.4.17/linux/fs/supermount/super_operations.c Fri Feb 1 14:10:39 2002 +++ kernel-2.4.17-supermountok/linux/fs/supermount/super_operations.c Fri Feb 1 11:56:36 2002 @@ -279,10 +279,12 @@ return s; fail_parsing: s->s_dev = 0; - dput (root); fail_allocating_root: supermount_debug ("get root dentry failed"); - iput (root_inode); + if(root) + dput (root); + else + iput (root_inode); free_sbi (sbi); fail_no_memory: return NULL;


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:16 EST