Skip to contentSkip to conversation

Patch "UBI: fix check for "too many bytes"" has been added to the 3.14-stable tree

PATCH [email protected] 1 participant 1 message May 2, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

UBI: fix check for "too many bytes"

to the 3.14-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-check-for-too-many-bytes.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 299d0c5b27346a77a0777c993372bf8777d4f2e5 Mon Sep 17 00:00:00 2001

From: Brian Norris <[email protected]>
Date: Sat, 28 Feb 2015 02:23:28 -0800
Subject: UBI: fix check for "too many bytes"

From: Brian Norris <[email protected]>

commit 299d0c5b27346a77a0777c993372bf8777d4f2e5 upstream.

The comparison from the previous line seems to have been erroneously (partially) copied-and-pasted onto the next. The second line should be checking req.bytes, not req.lnum.

Coverity CID #139400

---
 drivers/mtd/ubi/cdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/cdev.c +1 -1
@@ -451,7 +451,7 @@ static long vol_cdev_ioctl(struct file *
 		/* Validate the request */
 		err = -EINVAL;
 		if (req.lnum < 0 || req.lnum >= vol->reserved_pebs ||
-		    req.bytes < 0 || req.lnum >= vol->usable_leb_size)
+		    req.bytes < 0 || req.bytes > vol->usable_leb_size)
 			break;
 
 		err = get_exclusive(desc);

Patches currently in stable-queue which might be from [email protected] are

queue-3.14/ubi-initialize-leb-number-variable.patch queue-3.14/ubi-fix-out-of-bounds-write.patch queue-3.14/ubi-account-for-bitflips-in-both-the-vid-header-and-data.patch queue-3.14/ubi-fix-check-for-too-many-bytes.patch