[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101212234503.305A4B27BF@basil.firstfloor.org>
Date: Mon, 13 Dec 2010 00:45:03 +0100 (CET)
From: Andi Kleen <andi@...stfloor.org>
To: samuel@...tiz.org, gregkh@...e.de, ak@...ux.intel.com,
linux-kernel@...r.kernel.org, stable@...nel.org
Subject: [PATCH] [8/223] irda: Fix parameter extraction stack overflow
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Ortiz <samuel@...tiz.org>
commit efc463eb508798da4243625b08c7396462cabf9f upstream.
Reported-by: Ilja Van Sprundel <ivansprundel@...ctive.com>
Signed-off-by: Samuel Ortiz <samuel@...tiz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
net/irda/parameters.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux/net/irda/parameters.c
===================================================================
--- linux.orig/net/irda/parameters.c
+++ linux/net/irda/parameters.c
@@ -298,6 +298,8 @@ static int irda_extract_string(void *sel
p.pi = pi; /* In case handler needs to know */
p.pl = buf[1]; /* Extract length of value */
+ if (p.pl > 32)
+ p.pl = 32;
IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __func__,
p.pi, p.pl);
@@ -318,7 +320,7 @@ static int irda_extract_string(void *sel
(__u8) str[0], (__u8) str[1]);
/* Null terminate string */
- str[p.pl+1] = '\0';
+ str[p.pl] = '\0';
p.pv.c = str; /* Handler will need to take a copy */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists