Author: pfg
Date: Mon Jan 11 19:25:43 2016
New Revision: 293683
URL: https://svnweb.freebsd.org/changeset/base/293683

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

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c    Mon Jan 11 19:22:58 2016        
(r293682)
+++ head/sys/fs/ext2fs/ext2_vfsops.c    Mon Jan 11 19:25:43 2016        
(r293683)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to