From: Olaf Hering hiddev_table[] is an array of pointers. the minor number is used as an offset. hiddev minors start either with zero, or with 96. If they start with 96, the offset must be reduced by HIDDEV_MINOR_BASE because only 16 minors are available. unplugging a hiddevice will zero data outside the hiddev_table array. this was spotted by Takashi Iwai. --- 25-akpm/drivers/usb/input/hiddev.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/usb/input/hiddev.c~out-of-bounds-access-in-hiddev_cleanup drivers/usb/input/hiddev.c --- 25/drivers/usb/input/hiddev.c~out-of-bounds-access-in-hiddev_cleanup Wed May 19 14:48:16 2004 +++ 25-akpm/drivers/usb/input/hiddev.c Wed May 19 14:48:16 2004 @@ -232,7 +232,7 @@ static int hiddev_fasync(int fd, struct static struct usb_class_driver hiddev_class; static void hiddev_cleanup(struct hiddev *hiddev) { - hiddev_table[hiddev->hid->minor] = NULL; + hiddev_table[hiddev->hid->minor - HIDDEV_MINOR_BASE] = NULL; usb_deregister_dev(hiddev->hid->intf, &hiddev_class); kfree(hiddev); } _