summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-01-11 19:25:43 +0000
committerpfg <pfg@FreeBSD.org>2016-01-11 19:25:43 +0000
commit4ba3f354902d216384ffbcd5a6b1b3e219d451ea (patch)
tree91679d07290552dee4d9957b5c4ed2d3ff78b524 /sys/fs
parent52388dd9b7708ba89d74861bbc50bda8bd38307c (diff)
downloadFreeBSD-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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c2
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);
OpenPOWER on IntegriCloud