svn commit: r349802 - head/sys/fs/ext2fs

Fedor Uporov fsu at FreeBSD.org
Sun Jul 7 08:58:04 UTC 2019


Author: fsu
Date: Sun Jul  7 08:58:02 2019
New Revision: 349802
URL: https://svnweb.freebsd.org/changeset/base/349802

Log:
  Add additional check for 'blocks per group' and 'fragments per group' superblock fields.
  
  These fields will not be equal only in case if bigalloc filesystem feature is turned on.
  This feature is not supported for now.
  
  Reported by:    Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
  Reported as:    FS-27-EXT2-12: Denial of Service in openat-0 (vm_fault_hold/ext2_clusteracct)
  
  MFC after:	2 weeks

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

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c	Sun Jul  7 08:56:13 2019	(r349801)
+++ head/sys/fs/ext2fs/ext2_vfsops.c	Sun Jul  7 08:58:02 2019	(r349802)
@@ -559,7 +559,12 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f
 		SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error,
 		    "zero blocks/fragments per group");
 		return (EINVAL);
+	} else if (fs->e2fs_bpg != fs->e2fs_fpg) {
+		SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error,
+		    "blocks per group not equal fragments per group");
+		return (EINVAL);
 	}
+
 	if (fs->e2fs_bpg != fs->e2fs_bsize * 8) {
 		SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error,
 		    "non-standard group size unsupported");


More information about the svn-src-all mailing list