linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] ext4: add check for inodes_count overflow in new resize ioctl
Date: Mon, 22 Apr 2013 11:55:45 -0300	[thread overview]
Message-ID: <20130422145539.GB519@andromeda.usersys.redhat.com> (raw)
In-Reply-To: <1366599425-11561-1-git-send-email-tytso@mit.edu>

Looks good.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

On Sun, Apr 21, 2013 at 10:57:05PM -0400, Theodore Ts'o wrote:
> Addresses-Red-Hat-Bugzilla: #913245
> 
> Reported-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Cc: stable@vger.kernel.org
> ---
>  fs/ext4/resize.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
> index 08d2312..b27c96d 100644
> --- a/fs/ext4/resize.c
> +++ b/fs/ext4/resize.c
> @@ -1882,6 +1882,10 @@ retry:
>  		return 0;
>  
>  	n_group = ext4_get_group_number(sb, n_blocks_count - 1);
> +	if (n_group > (0xFFFFFFFFUL / EXT4_INODES_PER_GROUP(sb))) {
> +		ext4_warning(sb, "resize would cause inodes_count overflow");
> +		return -EINVAL;
> +	}
>  	ext4_get_group_no_and_offset(sb, o_blocks_count - 1, &o_group, &offset);
>  
>  	n_desc_blocks = num_desc_blocks(sb, n_group + 1);
> -- 
> 1.7.12.rc0.22.gcdd159b
> 
> --
> 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

-- 
Carlos

      reply	other threads:[~2013-04-22 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22  2:57 [PATCH] ext4: add check for inodes_count overflow in new resize ioctl Theodore Ts'o
2013-04-22 14:55 ` Carlos Maiolino [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=20130422145539.GB519@andromeda.usersys.redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).