Skip to contentSkip to conversation

[2.5] double free in ext2?

DISCUSSION Oleg Drokin 2 participants 2 messages Mar 7, 2003

lore
Share & tools
lore
#0 lore raw

Hello!

I am playing with smatch and while testing my improved version of unfree.pl, I seems to have found a double free condition in ext2:

fs/ext2/super.c::ext2_fill_super() (I am looking at yesterday's 2.5 snapshot)

in line 784 we do kfree(sbi->s_group_desc); (then print "EXT2-fs: unable to read group descriptors\n") and go to failed_mount_group_desc, which reads (from line 821):
failed_mount_group_desc:

        kfree(sbi->s_group_desc);

2.4 is not affected.

Bye,
Oleg

#1 lore raw
Quoted 6 lines · Oleg Drokin

Hello!

I am playing with smatch and while testing my improved version of unfree.pl, I seems to have found a double free condition in ext2:

Quoted 7 lines

fs/ext2/super.c::ext2_fill_super() (I am looking at yesterday's 2.5 snapshot)

in line 784 we do kfree(sbi->s_group_desc); (then print "EXT2-fs: unable to read group descriptors\n") and go to failed_mount_group_desc, which reads (from line 821):
failed_mount_group_desc:

        kfree(sbi->s_group_desc);

yes, bug. Thanks.