Skip to content

Commit

Permalink
fbdev: atafb - add palette register check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
  • Loading branch information
Krzysztof-H authored and geertu committed Dec 6, 2009
1 parent 87fbaf6 commit 8546e3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/video/atafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8546e3c

Please sign in to comment.