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

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