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