From: Krzysztof Helt Date: Sat, 24 Oct 2009 15:18:23 +0000 (+0200) Subject: fbdev: atafb - add palette register check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8546e3ce6e37c359979b69862442f94e0ef0e03b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 37624f74e88b..b7687c55fe16 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);