[PATCH] braille_console: Read buffer overflow

From: Roel Kluin
Date: Tue Aug 11 2009 - 10:32:56 EST


Prevent write to console_buf[-1]

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
If console_newline is true and console_cursor equals WIDTH
c is written to console_buf[-1].

diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index d672cfe..fb4075b 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -322,7 +322,8 @@ static int vt_notifier_call(struct notifier_block *blk,
(WIDTH-1) * sizeof(*console_buf));
else
console_cursor++;
- console_buf[console_cursor-1] = c;
+ if (console_cursor != 0)
+ console_buf[console_cursor-1] = c;
break;
}
if (console_show)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/