lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16.y-ckt 075/180] UBI: fix out of bounds write
    Date
    3.16.7-ckt11 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Brian Norris <computersforpeace@gmail.com>

    commit d74adbdb9abf0d2506a6c4afa534d894f28b763f upstream.

    If aeb->len >= vol->reserved_pebs, we should not be writing aeb into the
    PEB->LEB mapping.

    Caught by Coverity, CID #711212.

    Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    drivers/mtd/ubi/eba.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
    index 0e11671dadc4..930cf2c77abb 100644
    --- a/drivers/mtd/ubi/eba.c
    +++ b/drivers/mtd/ubi/eba.c
    @@ -1362,7 +1362,8 @@ int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
    * during re-size.
    */
    ubi_move_aeb_to_list(av, aeb, &ai->erase);
    - vol->eba_tbl[aeb->lnum] = aeb->pnum;
    + else
    + vol->eba_tbl[aeb->lnum] = aeb->pnum;
    }
    }


    \
     
     \ /
      Last update: 2015-05-07 12:41    [W:4.188 / U:0.340 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site