Re: [PATCH] USB: USBHID: Fix race between disconnect and hiddev_ioctl

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Valentine Barshak
Date: Monday, December 6, 2010 - 7:03 am

Dmitry Torokhov wrote:
It's not just HIDIOCGVERSION. A couple of other commands 
(HIDIOCGFLAG/HIDIOCSFLAG) didn't check device existence in the first 
place either.
Current implementation depends on when the device is actually removed.
If it has been removed before the hiddev_ioctl(), hiddev_ioctl() returns 
-EIO.
If the device is removed while hiddev_ioctl() is in progress, we either 
do not notice that and handle HIDIOCGVERSION and HIDIOCGFLAG/HIDIOCSFLAG
just fine, or return -ENODEV.
I'll submit a patch in a bit that applies on top of the "[PATCH] USB: 
USBHID: Fix race between disconnect and hiddev_ioctl" and makes the 
hiddev_ioctl() check
device existence before processing the command and always return -ENODEV 
in case the device has been removed.
Thanks,
Val.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] USB: USBHID: Fix race between disconnect and hidde ..., Valentine Barshak, (Fri Dec 3, 10:27 am)
Re: [PATCH] USB: USBHID: Fix race between disconnect and h ..., Valentine Barshak, (Mon Dec 6, 7:03 am)