All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "UBI: Validate data_size" has been added to the 3.10-stable tree
@ 2015-10-17 23:53 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-10-17 23:53 UTC (permalink / raw)
  To: richard, david, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    UBI: Validate data_size

to the 3.10-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-validate-data_size.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 281fda27673f833a01d516658a64d22a32c8e072 Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard@nod.at>
Date: Tue, 22 Sep 2015 23:58:07 +0200
Subject: UBI: Validate data_size

From: Richard Weinberger <richard@nod.at>

commit 281fda27673f833a01d516658a64d22a32c8e072 upstream.

Make sure that data_size is less than LEB size.
Otherwise a handcrafted UBI image is able to trigger
an out of bounds memory access in ubi_compare_lebs().

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/ubi/io.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -931,6 +931,11 @@ static int validate_vid_hdr(const struct
 		goto bad;
 	}
 
+	if (data_size > ubi->leb_size) {
+		ubi_err("bad data_size");
+		goto bad;
+	}
+
 	if (vol_type == UBI_VID_STATIC) {
 		/*
 		 * Although from high-level point of view static volumes may


Patches currently in stable-queue which might be from richard@nod.at are

queue-3.10/ubi-validate-data_size.patch
queue-3.10/ubi-return-enospc-if-no-enough-space-available.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-17 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-17 23:53 Patch "UBI: Validate data_size" has been added to the 3.10-stable tree gregkh

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.