All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Bardone <sbardone@chelsio.com>
To: Hans-Peter Jansen <hpj@urpla.net>
Cc: Jeff Garzik <jgarzik@pobox.com>, Adrian Bunk <bunk@stusta.de>,
	maintainers@chelsio.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: drivers/net/chelsio/sge.c: two array overflows
Date: Fri, 17 Mar 2006 10:46:18 -0800	[thread overview]
Message-ID: <441B03FA.9020004@chelsio.com> (raw)
In-Reply-To: <200603171319.20935.hpj@urpla.net>

Thanks Pete,

This is correct, the array should contain 3 elements. The bug was we were 
accessing a 4th element ([3]) which did not exist. We should be modifying the 
last element ([2]) instead.

-Scott

Hans-Peter Jansen wrote:
> [from the nitpick department..]
> 
> Hi Jeff, hi Scott,
> 
> Adrian wrote:
> 
>>The Coverity checker spotted the following two array overflows in 
>>drivers/net/chelsio/sge.c (in both cases, the arrays contain 3 
>>elements):
> 
> 
> Am Freitag, 17. März 2006 01:21 schrieb Jeff Garzik:
> 
>>Scott Bardone wrote:
>>
>>>Adrian,
>>>
>>>This is a bug. The array should contain 2 elements.
>>>
>>>Attached is a patch which fixes it.
>>>Thanks.
>>>
>>>Signed-off-by: Scott Bardone <sbardone@chelsio.com>
>>
>>applied.  please avoid attachments and use a proper patch description
>>in the future.  I had to hand-edit and hand-apply your patch.
> 
> 
> where you wrote in kernel tree commit 
> 347a444e687b5f8cf0f6485704db1c6024d3:
> This is a bug. The array should contain 2 elements.  Here is the fix.
> 
> If I'm not completely off the track, you both committed a description 
> off by one error: since the patch doesn't change the array size, it's 
> presumely¹ still 3 elements, where index 2 references the last one.
> 
> Here's hopefully a better patch description:
> Fixed off by one thinko in stats accounting, spotted by Coverity 
> checker, notified by Adrian "The Cleanman" Bunk.
> 
> SCR,
> Pete
> 
> ¹) otherwise, it's still off by one..

      reply	other threads:[~2006-03-17 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-11  1:37 drivers/net/chelsio/sge.c: two array overflows Adrian Bunk
2006-03-13 19:31 ` Scott Bardone
2006-03-17  0:21   ` Jeff Garzik
2006-03-17 12:19     ` Hans-Peter Jansen
2006-03-17 18:46       ` Scott Bardone [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=441B03FA.9020004@chelsio.com \
    --to=sbardone@chelsio.com \
    --cc=bunk@stusta.de \
    --cc=hpj@urpla.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maintainers@chelsio.com \
    --cc=netdev@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 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.