[3.19.y-ckt stable] Patch "Input: zforce - don't overwrite the stack" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Thu Aug 27 22:07:55 UTC 2015


This is a note to let you know that I have just added a patch titled

    Input: zforce - don't overwrite the stack

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt6.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 361a8dc83806010e90a12beac0df98a63d8a9a27 Mon Sep 17 00:00:00 2001
From: Oleksij Rempel <external.Oleksij.Rempel at de.bosch.com>
Date: Mon, 13 Jul 2015 09:54:42 -0700
Subject: Input: zforce - don't overwrite the stack

commit 7d01cd261c76f95913c81554a751968a1d282d3a upstream.

If we get a corrupted packet with PAYLOAD_LENGTH > FRAME_MAXSIZE, we
will silently overwrite the stack.

Signed-off-by: Oleksij Rempel <external.Oleksij.Rempel at de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme at de.bosch.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov at gmail.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/input/touchscreen/zforce_ts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 19880c7..a9e1ee3 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -430,7 +430,7 @@ static int zforce_read_packet(struct zforce_ts *ts, u8 *buf)
 		goto unlock;
 	}

-	if (buf[PAYLOAD_LENGTH] == 0) {
+	if (buf[PAYLOAD_LENGTH] == 0 || buf[PAYLOAD_LENGTH] > FRAME_MAXSIZE) {
 		dev_err(&client->dev, "invalid payload length: %d\n",
 			buf[PAYLOAD_LENGTH]);
 		ret = -EIO;
--
1.9.1





More information about the kernel-team mailing list