[ 3.5.y.z extended stable ] Patch "staging: speakup: avoid out-of-range access in synth_init()" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Wed Jan 23 04:42:14 UTC 2013


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

    staging: speakup: avoid out-of-range access in synth_init()

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

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

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.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

>From c905464fad321f419f1b9fd10ca0a741dad21719 Mon Sep 17 00:00:00 2001
From: Nickolai Zeldovich <nickolai at csail.mit.edu>
Date: Sat, 5 Jan 2013 14:17:45 -0500
Subject: [PATCH] staging: speakup: avoid out-of-range access in synth_init()

commit ae428655b826f2755a8101b27beda42a275ef8ad upstream.

Check that array index is in-bounds before accessing the synths[] array.

Signed-off-by: Nickolai Zeldovich <nickolai at csail.mit.edu>
Cc: Samuel Thibault <samuel.thibault at ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
---
 drivers/staging/speakup/synth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 331eae7..217fd4a 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -342,7 +342,7 @@ int synth_init(char *synth_name)

 	mutex_lock(&spk_mutex);
 	/* First, check if we already have it loaded. */
-	for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
+	for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
 		if (strcmp(synths[i]->name, synth_name) == 0)
 			synth = synths[i];

--
1.7.9.5





More information about the kernel-team mailing list