All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] mke2fs: don't accept too-high revision levels
Date: Thu, 14 Jan 2016 12:36:11 -0700	[thread overview]
Message-ID: <AF0456DC-B670-4840-A5A4-82222C8ED53A@dilger.ca> (raw)
In-Reply-To: <5697EA79.40902@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]


> On Jan 14, 2016, at 11:35 AM, Eric Sandeen <sandeen@redhat.com> wrote:
> 
> Came across this, still not merged, so ping?
> 
> On 5/1/14 2:55 PM, Eric Sandeen wrote:
>> 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>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

>> ---
>> 
>> 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;
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2016-01-14 19:36 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   ` [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 message]

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=AF0456DC-B670-4840-A5A4-82222C8ED53A@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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.