Re: [PATCH] kobject: Read buffer overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 02, 2009 at 12:06:59PM +0200, Thibaut VARENE wrote:
> On Sun, Aug 2, 2009 at 10:02 AM, Roel Kluin<roel.kluin@xxxxxxxxx> wrote:
> > Check whether index is within bounds before testing the element.
> 
> The change is correct but:
> - There are other places in the code with that construct. Even though
> they wouldn't trigger an overflow, why not fixing them too?
> - Keep the likely: we are more likely to run out of data in the layers
> than to exhaust the counter (which is why no overflow was ever
> triggered, I believe ;-)

No, lose the likely.  It's a for-loop; gcc will do the right thing.

(If you think I'm wrong, convince me by showing the disassembly of the
compiled code with and without the likely).

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux