public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] ore: signedness bug in _sp2d_min_pg()
Date: Tue, 02 Oct 2012 21:38:23 +0000	[thread overview]
Message-ID: <506B5ECF.6050409@panasas.com> (raw)
In-Reply-To: <20121002082845.GH12398@elgon.mountain>

On 10/02/2012 01:28 AM, Dan Carpenter wrote:
> This for loop doesn't work correctly when "p" is unsigned.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

My god, yes thanks.

It is a sure overrun crash. I wonder why it never hit till
today.

Thanks will apply ASAP
Boaz

> diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
> index 5f376d1..b963f38 100644
> --- a/fs/exofs/ore_raid.c
> +++ b/fs/exofs/ore_raid.c
> @@ -203,7 +203,7 @@ static unsigned _sp2d_min_pg(struct __stripe_pages_2d *sp2d)
>  
>  static unsigned _sp2d_max_pg(struct __stripe_pages_2d *sp2d)
>  {
> -	unsigned p;
> +	int p;
>  
>  	for (p = sp2d->pages_in_unit - 1; p >= 0; --p) {
>  		struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p];
> 



      reply	other threads:[~2012-10-02 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02  8:28 [patch] ore: signedness bug in _sp2d_min_pg() Dan Carpenter
2012-10-02 21:38 ` Boaz Harrosh [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=506B5ECF.6050409@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=kernel-janitors@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