diff options
author | pfg <pfg@FreeBSD.org> | 2016-01-11 19:25:43 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-01-11 19:25:43 +0000 |
commit | 4ba3f354902d216384ffbcd5a6b1b3e219d451ea (patch) | |
tree | 91679d07290552dee4d9957b5c4ed2d3ff78b524 | |
parent | 52388dd9b7708ba89d74861bbc50bda8bd38307c (diff) | |
download | FreeBSD-src-4ba3f354902d216384ffbcd5a6b1b3e219d451ea.zip FreeBSD-src-4ba3f354902d216384ffbcd5a6b1b3e219d451ea.tar.gz |
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
MFC after: 3 days
-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); |