From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43090 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbbEBREj (ORCPT ); Sat, 2 May 2015 13:04:39 -0400 Subject: Patch "UBI: fix out of bounds write" has been added to the 4.0-stable tree To: computersforpeace@gmail.com, gregkh@linuxfoundation.org, richard@nod.at Cc: , From: Date: Sat, 02 May 2015 19:01:30 +0200 Message-ID: <14305860909090@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled UBI: fix out of bounds write to the 4.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ubi-fix-out-of-bounds-write.patch and it can be found in the queue-4.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From d74adbdb9abf0d2506a6c4afa534d894f28b763f Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Sat, 28 Feb 2015 02:23:26 -0800 Subject: UBI: fix out of bounds write From: Brian Norris 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 Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/ubi/eba.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -1419,7 +1419,8 @@ int ubi_eba_init(struct ubi_device *ubi, * 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; } } Patches currently in stable-queue which might be from computersforpeace@gmail.com are queue-4.0/ubi-initialize-leb-number-variable.patch queue-4.0/ubi-fix-out-of-bounds-write.patch queue-4.0/ubi-account-for-bitflips-in-both-the-vid-header-and-data.patch queue-4.0/ubi-fix-check-for-too-many-bytes.patch