All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mke2fs: don't accept too-high revision levels
@ 2014-05-01 19:55 Eric Sandeen
  2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
  2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-05-01 19:55 UTC (permalink / raw)
  To: ext4 development

It's a bit strange to accept revision levels higher than
the code creating the filesystem can understand, so don't
allow it.

At least the kernel will mount the fs readonly if it's too
high, but no other utility will touch it, so you can't
fix the error.

Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index aecd5d5..82019dc 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1679,9 +1679,10 @@ profile_error:
 			break;
 		case 'r':
 			r_opt = strtoul(optarg, &tmp, 0);
-			if (*tmp) {
+			if (*tmp || (r_opt > EXT2_MAX_SUPP_REV)) {
 				com_err(program_name, 0,
-					_("bad revision level - %s"), optarg);
+					_("bad revision level - %s (max %d)"),
+					   optarg, EXT2_MAX_SUPP_REV);
 				exit(1);
 			}
 			fs_param.s_rev_level = r_opt;


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-14 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 19:55 [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
2014-05-01 22:20   ` Andreas Dilger
2014-05-01 22:35   ` [PATCH V3] " Eric Sandeen
2014-07-04 19:32     ` Theodore Ts'o
2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
2016-01-14 19:36   ` Andreas Dilger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.