Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1203403 > unrolled thread

[PATCH 4.1 076/123] Input: zforce - dont overwrite the stack

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2015-08-09 00:20 +0200
Last post2015-08-10 21:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.1 076/123] Input: zforce - dont overwrite the stack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-09 00:20 +0200
    Re: [PATCH 4.1 076/123] Input: zforce - dont overwrite the stack Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-08-09 00:40 +0200
      Re: [PATCH 4.1 076/123] Input: zforce - dont overwrite the stack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-10 21:20 +0200

#1203403 — [PATCH 4.1 076/123] Input: zforce - dont overwrite the stack

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-08-09 00:20 +0200
Subject[PATCH 4.1 076/123] Input: zforce - dont overwrite the stack
Message-ID<pVkD8-3vG-25@gated-at.bofh.it>
4.1-stable review patch.  If anyone has any objections, please let me know.

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

From: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>

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@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/touchscreen/zforce_ts.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -430,7 +430,7 @@ static int zforce_read_packet(struct zfo
 		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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1203495

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2015-08-09 00:40 +0200
Message-ID<pVkWv-3Tb-61@gated-at.bofh.it>
In reply to#1203403
Hi Greg,

On August 8, 2015 3:09:14 PM PDT, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>4.1-stable review patch.  If anyone has any objections, please let me
>know.

This was a bad patch and its reverted n mainline, please drop.

>
>------------------
>
>From: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
>
>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@de.bosch.com>
>Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
>Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
>---
> drivers/input/touchscreen/zforce_ts.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>--- a/drivers/input/touchscreen/zforce_ts.c
>+++ b/drivers/input/touchscreen/zforce_ts.c
>@@ -430,7 +430,7 @@ static int zforce_read_packet(struct zfo
> 		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;


Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204505

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-08-10 21:20 +0200
Message-ID<pW0M3-73c-39@gated-at.bofh.it>
In reply to#1203495
On Sat, Aug 08, 2015 at 03:37:57PM -0700, Dmitry Torokhov wrote:
> Hi Greg,
> 
> On August 8, 2015 3:09:14 PM PDT, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >4.1-stable review patch.  If anyone has any objections, please let me
> >know.
> 
> This was a bad patch and its reverted n mainline, please drop.

Now dropped, thanks for letting me know.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web