summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-10-24 17:18:23 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2009-12-06 11:18:27 +0100
commit8546e3ce6e37c359979b69862442f94e0ef0e03b (patch)
tree6c4a3cbac72565a3de08c623cc29b787880c2e2a
parentm68k: Remove the BKL from sys_execve (diff)
downloadlinux-8546e3ce6e37c359979b69862442f94e0ef0e03b.tar.xz
linux-8546e3ce6e37c359979b69862442f94e0ef0e03b.zip
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 <krzysztof.h1@wp.pl> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--drivers/video/atafb.c3
1 files changed, 3 insertions, 0 deletions
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);