diff options
author | pfg <pfg@FreeBSD.org> | 2016-01-14 01:50:06 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-01-14 01:50:06 +0000 |
commit | 407b5ea098dee26f49d28da49a645b40d8b745d5 (patch) | |
tree | 6dc1c36ef546783762fadf81a282485378cb6cd0 /sys/fs | |
parent | e37f0a84b3ddb2223de9c1b95772a082dfcd7608 (diff) | |
download | FreeBSD-src-407b5ea098dee26f49d28da49a645b40d8b745d5.zip FreeBSD-src-407b5ea098dee26f49d28da49a645b40d8b745d5.tar.gz |
MFC r293683:
ext4: mount panic from freeing invalid pointers
Initialize the struct with those fields to zeroes on allocation,
preventing the panic.
Patch by: Damjan Jovanovic.
PR: 206056
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index ce943ea..5339aa2 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -590,7 +590,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) * while Linux keeps the super block in a locked buffer. */ ump->um_e2fs = malloc(sizeof(struct m_ext2fs), - M_EXT2MNT, M_WAITOK); + M_EXT2MNT, M_WAITOK | M_ZERO); ump->um_e2fs->e2fs = malloc(sizeof(struct ext2fs), M_EXT2MNT, M_WAITOK); mtx_init(EXT2_MTX(ump), "EXT2FS", "EXT2FS Lock", MTX_DEF); |