applicom: use correct array offset
Subsystems (2)
PATCH 1/1 applicom: use correct array offset
We're iterating through abps[] printing information, but here we use the wrong array index. IndexCard comes from the user and in this case it was specifically not range checked because we didn't expect to use it.
drivers/char/applicom.c +2 -2
@@ -804,8 +804,8 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)printk (KERN_INFO "Prom version board %d ....... V%d.%d %s" , i+1 , - (int )(readb (apbs[IndexCard].RamIO +VERS ) >>4 ), - (int )(readb (apbs[IndexCard].RamIO +VERS ) &0xF ), + (int )(readb (apbs[i].RamIO +VERS ) >>4 ), + (int )(readb (apbs[i].RamIO +VERS ) &0xF ), boardname);
Quoted 6 lines · Dan Carpenter
We're iterating through abps[] printing information, but here we use the wrong array index. IndexCard comes from the user and in this case it was specifically not range checked because we didn't expect to use it.
Signed-off-by Dan Carpenter <[email protected]>
Wow, that is a crappy driver ;-) Dave Woodhouse was apparently the last person who understood it and had something to do with it, and that was back in the 90s. It looks like the vendor actually has its own (much worse) driver for this product line and only supports more recent cards than our driver does. I doubt that there is anyone using this.
Should we just kill the driver?
Arnd