From: Artem Bityutskiy <dedekind@infradead.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] ubi: gluebi_{read,write} len + {from,to} can exceed mtd->size
Date: Mon, 22 Jun 2009 19:17:09 +0300 [thread overview]
Message-ID: <1245687429.9487.52.camel@localhost.localdomain> (raw)
In-Reply-To: <4A3FBDA2.3070403@gmail.com>
On Mon, 2009-06-22 at 19:21 +0200, Roel Kluin wrote:
> when size_t `len' is negative it is wrapped so the test `len < 0' fails.
> `from' and `to' have type loff_t (signed). During the addition `len' is
> converted to signed. So when `len' is negative `from + len` can be
> less than `mtd->size' while `from' is larger than `mtd->size'. This
> patch fixes this.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Thanks, pushed to ubi-2.6.git tree with slightly amended commit message:
commit cf9e1e425172035575bee070df031c8a58015cb8
Author: Roel Kluin <roel.kluin@gmail.com>
Date: Mon Jun 22 19:21:38 2009 +0200
UBI: fix input parameters check in gluebi
size_t `len' is unsigned `len < 0' always fails.
`from' and `to' have type loff_t (signed). During the addition `len' is
converted to signed. So when `len' is negative `from + len` can be
less than `mtd->size' while `from' is larger than `mtd->size'. This
patch fixes this.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
prev parent reply other threads:[~2009-06-22 16:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 17:21 [PATCH] ubi: gluebi_{read, write} len + {from, to} can exceed mtd->size Roel Kluin
2009-06-22 16:17 ` Artem Bityutskiy [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=1245687429.9487.52.camel@localhost.localdomain \
--to=dedekind@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-mtd@lists.infradead.org \
--cc=roel.kluin@gmail.com \
/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.