svn commit: r293866 - stable/10/sys/fs/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Thu Jan 14 01:50:07 UTC 2016


Author: pfg
Date: Thu Jan 14 01:50:06 2016
New Revision: 293866
URL: https://svnweb.freebsd.org/changeset/base/293866

Log:
  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

Modified:
  stable/10/sys/fs/ext2fs/ext2_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- stable/10/sys/fs/ext2fs/ext2_vfsops.c	Thu Jan 14 01:42:09 2016	(r293865)
+++ stable/10/sys/fs/ext2fs/ext2_vfsops.c	Thu Jan 14 01:50:06 2016	(r293866)
@@ -590,7 +590,7 @@ ext2_mountfs(struct vnode *devvp, struct
 	 * 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);


More information about the svn-src-all mailing list