Thread (3 messages) flat view 3 messages, 3 authors, 2011-10-14

Re: possible race between reset and error handling in usbhid

From: Oliver Neukum <hidden>
Date: 2011-10-14 06:37:09

Am Donnerstag, 13. Oktober 2011, 18:20:52 schrieb Jiri Kosina:
On Wed, 12 Oct 2011, Oliver Neukum wrote:
quoted
looking at the usbhid code it seems to me that there is no protection
between the error handling code and pre_reset() racing.

In particular there seems to be no protection from hid_retry_timeout() calling
hid_start_in() which would start IO after hid_pre_reset() has already called
hid_cease_io() because that uses del_timer(), not del_timer_sync()

What do you think about this patch?
Looks like you made a good catch, thanks. Out of curiosity -- did you 
encounter this happening for real, or have you find out by code reading?
A bit of both. I was looking for causes of a mysterious bug report that
just mentions HID devices and resets and is known to be a race.
So I may have indirectly encountered it.

	Regards
		Oliver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help