From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] mke2fs: don't accept too-high revision levels
Date: Thu, 01 May 2014 14:55:14 -0500 [thread overview]
Message-ID: <5362A6A2.7040504@redhat.com> (raw)
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;
next reply other threads:[~2014-05-01 19:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-01 19:55 Eric Sandeen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5362A6A2.7040504@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.