Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 01:50:06 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293866 - stable/10/sys/fs/ext2fs
Message-ID:  <201601140150.u0E1o67J090372@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601140150.u0E1o67J090372>