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
This commit is contained in:
parent
e813d9d7fa
commit
daf884fa9f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293683
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user