From 8546e3ce6e37c359979b69862442f94e0ef0e03b Mon Sep 17 00:00:00 2001 From: Krzysztof Helt Date: Sat, 24 Oct 2009 17:18:23 +0200 Subject: fbdev: atafb - add palette register check Add check if palette register number is in correct range for few drivers which miss it. The regno value comes indirectly from user space. Signed-off-by: Krzysztof Helt Signed-off-by: Geert Uytterhoeven diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 37624f7..b7687c5 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c @@ -2242,6 +2242,9 @@ static int ext_setcolreg(unsigned int regno, unsigned int red, if (!external_vgaiobase) return 1; + if (regno > 255) + return 1; + switch (external_card_type) { case IS_VGA: OUTB(0x3c8, regno); -- cgit v0.10.2