Skip to content

Commit

Permalink
fs/affs/super.c: bugfix / double free
Browse files Browse the repository at this point in the history
Commit 842a859 ("affs: use ->kill_sb() to simplify ->put_super()
and failure exits of ->mount()") adds .kill_sb which frees sbi but
doesn't remove sbi free in case of parse_options error causing double
free+random crash.

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: <[email protected]>	[3.14.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed May 6, 2014
1 parent 1e2ee49 commit d353efd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
&blocksize,&sbi->s_prefix,
sbi->s_volume, &mount_flags)) {
printk(KERN_ERR "AFFS: Error parsing options\n");
kfree(sbi->s_prefix);
kfree(sbi);
return -EINVAL;
}
/* N.B. after this point s_prefix must be released */
Expand Down

0 comments on commit d353efd

Please sign in to comment.