[PATCH] mtd-utils: Check mtdoffset is not larger than mtd.size in case of a bad block.
Artem Bityutskiy
dedekind1 at gmail.com
Fri Jun 29 04:32:21 EDT 2012
On Tue, 2012-06-26 at 14:46 -0700, Tomer Barletz wrote:
> mtdoffset is being tested against mtd.size in the outer two loops, but
> the third nested one does not test against it.
> In case of a bad block we'll try to access an out of bounds offset in
> the next MEMGETBADBLOCK ioctl, which will fail with EINVAL.
> In case mtdoffset is indeed larger than the partition size, we need to
> bail, since there are not enough "good" blocks to complete the write.
>
> Signed-off-by: Tomer Barletz <barletz at gmail.com>
Pushed to mtd-utils, thanks!
--
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120629/e580d62f/attachment-0001.sig>
More information about the linux-mtd
mailing list