linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jonathan Brassow <jbrassow@redhat.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] DM RAID: Fix comparison of index and quantity for "rebuild" parameter
Date: Thu, 6 Sep 2012 06:22:40 +1000	[thread overview]
Message-ID: <20120906062240.23b224f9@notabene.brown> (raw)
In-Reply-To: <1346860400.10156.50.camel@f16>

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

On Wed, 05 Sep 2012 10:53:20 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:

> DM RAID: Fix comparison of index and quantity for "rebuild" parameter
> 
> The "rebuild" parameter takes an index argument that starts counting from
> zero.  The conditional used to validate the index was using '>' rather than
> '>=', leaving the door open for an index value that would be 1 too large.
> 
> Reported-by: Neil Brown <neilb@suse.de>
> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
> 
> Index: linux-upstream/drivers/md/dm-raid.c
> ===================================================================
> --- linux-upstream.orig/drivers/md/dm-raid.c
> +++ linux-upstream/drivers/md/dm-raid.c
> @@ -539,7 +539,7 @@ static int parse_raid_params(struct raid
>  
>  		/* Parameters that take a numeric value are checked here */
>  		if (!strcasecmp(key, "rebuild")) {
> -			if (value > rs->md.raid_disks) {
> +			if (value >= rs->md.raid_disks) {
>  				rs->ti->error = "Invalid rebuild index given";
>  				return -EINVAL;
>  			}
> 

Applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-09-05 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 15:53 [PATCH] DM RAID: Fix comparison of index and quantity for "rebuild" parameter Jonathan Brassow
2012-09-05 20:22 ` NeilBrown [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=20120906062240.23b224f9@notabene.brown \
    --to=neilb@suse.de \
    --cc=jbrassow@redhat.com \
    --cc=linux-raid@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).