Skip to content

Commit

Permalink
[GFS2] panic after can't parse mount arguments
Browse files Browse the repository at this point in the history
When you try to mount gfs2 with -o garbage, the mount fails and the gfs2
superblock is deallocated and becomes NULL. The vfs comes around later
on and calls gfs2_kill_sb. At this point the hidden gfs2 superblock
pointer (sb->s_fs_info) is NULL and dereferencing it through
gfs2_meta_syncfs causes the panic. (the other function call to
gfs2_delete_debugfs_file() succeeds because this function already checks
for a NULL pointer)

Signed-off-by: Abhijith Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Abhijith Das authored and Steven Whitehouse committed Oct 10, 2007
1 parent ec217e0 commit d1e2777
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,10 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,

static void gfs2_kill_sb(struct super_block *sb)
{
gfs2_delete_debugfs_file(sb->s_fs_info);
gfs2_meta_syncfs(sb->s_fs_info);
if (sb->s_fs_info) {
gfs2_delete_debugfs_file(sb->s_fs_info);
gfs2_meta_syncfs(sb->s_fs_info);
}
kill_block_super(sb);
}

Expand Down

0 comments on commit d1e2777

Please sign in to comment.