svn commit: r293867 - stable/9/sys/fs/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Thu Jan 14 01:51:19 UTC 2016


Author: pfg
Date: Thu Jan 14 01:51:18 2016
New Revision: 293867
URL: https://svnweb.freebsd.org/changeset/base/293867

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/9/sys/fs/ext2fs/ext2_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vfsops.c	Thu Jan 14 01:50:06 2016	(r293866)
+++ stable/9/sys/fs/ext2fs/ext2_vfsops.c	Thu Jan 14 01:51:18 2016	(r293867)
@@ -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