From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>,
Frank Sorenson <fsorenso@redhat.com>
Subject: [PATCH V3] mke2fs: prevent creation of filesystem with unsupported revision
Date: Thu, 01 May 2014 17:35:00 -0500 [thread overview]
Message-ID: <5362CC14.2070902@redhat.com> (raw)
In-Reply-To: <5362B105.9080702@redhat.com>
From: Frank Sorenson <fsorenso@redhat.com>
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: Frank Sorenson <fsorenso@redhat.com>
[sandeen@redhat.com: Add more verbose commit log]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
V2: Frank did this independently, and it's better. I forgot about
using com_err here.
V3: go back to V1's commit log for Andreas :)
--- a/misc/mke2fs.c
+++ a/misc/mke2fs.c
@@ -1684,6 +1684,11 @@ profile_error:
_("bad revision level - %s"), optarg);
exit(1);
}
+ if (r_opt > EXT2_MAX_SUPP_REV) {
+ com_err(program_name, EXT2_ET_REV_TOO_HIGH,
+ _("while trying to create revision %d"), r_opt);
+ exit(1);
+ }
fs_param.s_rev_level = r_opt;
break;
case 's': /* deprecated */
next prev parent reply other threads:[~2014-05-01 22:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Eric Sandeen [this message]
2014-07-04 19:32 ` [PATCH V3] " 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=5362CC14.2070902@redhat.com \
--to=sandeen@redhat.com \
--cc=fsorenso@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).