aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-04-16 05:08:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-17 13:01:22 -0400
commit1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104 (patch)
tree4b3081b33d820b387124cfb3836befc229c4a809 /drivers/usb
parent75b9130e8af64c6878a1aa396a8446f3ce2cfb49 (diff)
usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep
When usbfs receives a ctrl-request from userspace it calls check_ctrlrecip, which for a request with USB_RECIP_ENDPOINT tries to map this to an interface to see if this interface is claimed, except for ctrl-requests with a type of USB_TYPE_VENDOR. When trying to use this device: http://www.akaipro.com/eiepro redirected to a Windows vm running on qemu on top of Linux. The windows driver makes a ctrl-req with USB_TYPE_CLASS and USB_RECIP_ENDPOINT with index 0, and the mapping of the endpoint (0) to the interface fails since ep 0 is the ctrl endpoint and thus never is part of an interface. This patch fixes this ctrl-req failing by skipping the checkintf call for USB_RECIP_ENDPOINT ctrl-reqs on the ctrl endpoint. Reported-by: Dave Stikkolorum <d.r.stikkolorum@hhs.nl> Tested-by: Dave Stikkolorum <d.r.stikkolorum@hhs.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/devio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 8823e98989fe..caefc800f298 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -739,6 +739,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
739 index &= 0xff; 739 index &= 0xff;
740 switch (requesttype & USB_RECIP_MASK) { 740 switch (requesttype & USB_RECIP_MASK) {
741 case USB_RECIP_ENDPOINT: 741 case USB_RECIP_ENDPOINT:
742 if ((index & ~USB_DIR_IN) == 0)
743 return 0;
742 ret = findintfep(ps->dev, index); 744 ret = findintfep(ps->dev, index);
743 if (ret >= 0) 745 if (ret >= 0)
744 ret = checkintf(ps, ret); 746 ret = checkintf(ps, ret);