Skip to contentSkip to conversation

fs/affs/super.c: bugfix / double free

PATCH New Fabian Frederick 1 participant 1 message May 4, 2014 Affs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/affs/super.c: bugfix / double free

842a859db26b70
("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.

Cc Alexander Viro <[email protected]>
Cc Andrew Morton <[email protected]>
---
 fs/affs/super.c | 2 --
 1 file changed, 2 deletions(-)
fs/affs/super.c +0 -2
index 6d589f2..895ac7d 100644
@@ -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 */
Signature · 1 line
1.8.4.5