Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 01:51:18 +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-9@freebsd.org
Subject:   svn commit: r293867 - stable/9/sys/fs/ext2fs
Message-ID:  <201601140151.u0E1pIm3092900@repo.freebsd.org>

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



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