Blame SOURCES/e2fsprogs-1.42.9-mkfs-revision-too-high.patch

ec15cf
commit 4b59352edb5ce783ba578d708de1fda981acfec6
ec15cf
Author: Frank Sorenson <fsorenso@redhat.com>
ec15cf
Date:   Fri Jul 4 15:31:50 2014 -0400
ec15cf
ec15cf
    mke2fs: prevent creation of filesystem with unsupported revision
ec15cf
    
ec15cf
    It's a bit strange to accept revision levels higher than
ec15cf
    the code creating the filesystem can understand, so don't
ec15cf
    allow it.
ec15cf
    
ec15cf
    At least the kernel will mount the fs readonly if it's too
ec15cf
    high, but no other utility will touch it, so you can't
ec15cf
    fix the error.
ec15cf
    
ec15cf
    Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.
ec15cf
    
ec15cf
    Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
ec15cf
    [sandeen@redhat.com: Add more verbose commit log]
ec15cf
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
ec15cf
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
ec15cf
ec15cf
Index: e2fsprogs-1.42.9/misc/mke2fs.c
ec15cf
===================================================================
ec15cf
--- e2fsprogs-1.42.9.orig/misc/mke2fs.c
ec15cf
+++ e2fsprogs-1.42.9/misc/mke2fs.c
ec15cf
@@ -1570,6 +1570,11 @@ profile_error:
ec15cf
 					_("bad revision level - %s"), optarg);
ec15cf
 				exit(1);
ec15cf
 			}
ec15cf
+			if (r_opt > EXT2_MAX_SUPP_REV) {
ec15cf
+				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
ec15cf
+					_("while trying to create revision %d"), r_opt);
ec15cf
+				exit(1);
ec15cf
+			}
ec15cf
 			fs_param.s_rev_level = r_opt;
ec15cf
 			break;
ec15cf
 		case 's':	/* deprecated */