aha/drivers/hid/usbhid
Oliver Neukum 69626f23bc HID: fix race between open() and disconnect() in usbhid
There is a window:

task A					task B
spin_lock_irq(&usbhid->inlock);	/* Sync with error handler */
usb_set_intfdata(intf, NULL);
spin_unlock_irq(&usbhid->inlock);
usb_kill_urb(usbhid->urbin);
usb_kill_urb(usbhid->urbout);
usb_kill_urb(usbhid->urbctrl);

del_timer_sync(&usbhid->io_retry);
cancel_work_sync(&usbhid->reset_work);

						if (!hid->open++) {
							res = usb_autopm_get_interface(usbhid->intf);
							if (res < 0) {
								hid->open--;
								return -EIO;
							}
						}
						if (hid_start_in(hid))

if (hid->claimed & HID_CLAIMED_INPUT)
	hidinput_disconnect(hid);

in which an open() to an already disconnected device will submit an URB
to an undead device. In case disconnect() was called by an ioctl, this'll
oops. Fix by introducing a new flag and checking it in hid_start_in().

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-04-22 11:34:58 +02:00
..
hid-core.c HID: fix race between open() and disconnect() in usbhid 2008-04-22 11:34:58 +02:00
hid-ff.c HID: force feedback driver for Logitech Rumblepad 2 2008-04-22 11:34:57 +02:00
hid-lg2ff.c HID: force feedback driver for Logitech Rumblepad 2 2008-04-22 11:34:57 +02:00
hid-lgff.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
hid-pidff.c HID: fix autocentering of PID devices 2007-07-09 14:13:35 +02:00
hid-plff.c HID: use hid-plff driver for GreenAsia 0e8f:0003 devices 2007-10-14 13:40:01 +02:00
hid-quirks.c HID: make hid_input_field and usbhid_modify_dquirk static 2008-04-22 11:34:58 +02:00
hid-tmff.c HID: fix a potential bug in pointer casting 2008-01-28 14:51:19 +01:00
hid-zpff.c HID: make debugging output runtime-configurable 2007-07-09 14:03:35 +02:00
hiddev.c HID: fix build failure in hiddev_ioctl with gcc 3.2 2008-04-22 11:34:56 +02:00
Kconfig HID: force feedback driver for Logitech Rumblepad 2 2008-04-22 11:34:57 +02:00
Makefile HID: force feedback driver for Logitech Rumblepad 2 2008-04-22 11:34:57 +02:00
usbhid.h HID: move wait from hid to usbhid 2008-04-22 11:34:57 +02:00
usbkbd.c HID: fix compilation of hidbp drivers without usbhid 2008-01-28 14:51:22 +01:00
usbmouse.c HID: fix compilation of hidbp drivers without usbhid 2008-01-28 14:51:22 +01:00