[patch 7/8] mtd: fix read buffer overflow

Artem Bityutskiy dedekind1 at gmail.com
Mon Aug 10 03:07:56 EDT 2009


On Thu, 2009-08-06 at 16:05 -0700, akpm at linux-foundation.org wrote:
> From: Roel Kluin <roel.kluin at gmail.com>
> 
> Check whether index is within bounds before testing the element.
> 
> with `for (i = 0; bbt[i] && i < ebcnt; ++i)'
> we test bbt[ebcnt] in the last iteration
> 
> with `for (i = 0; bbt[ebcnt - i - 1] && i < ebcnt; ++i)'
> we test bbt[-1] in the last iteration
> 
> Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
> Cc: David Woodhouse <dwmw2 at infradead.org>
> Signed-off-by: Andrew Morton <akpm at linux-foundation.org>

This one is in my l2-mtd-2.6.git as well now.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list