linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] mke2fs: don't accept too-high revision levels
Date: Thu, 14 Jan 2016 12:35:37 -0600	[thread overview]
Message-ID: <5697EA79.40902@redhat.com> (raw)
In-Reply-To: <5362A6A2.7040504@redhat.com>

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>
> ---
> 
> 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
> 


  parent reply	other threads:[~2016-01-14 18:35 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 ` Eric Sandeen [this message]
2016-01-14 19:36   ` [PATCH] mke2fs: don't accept too-high revision levels 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=5697EA79.40902@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 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).