Commit 1361bf4b authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

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: default avatarDave Stikkolorum <d.r.stikkolorum@hhs.nl>
Tested-by: default avatarDave Stikkolorum <d.r.stikkolorum@hhs.nl>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 75b9130e
...@@ -739,6 +739,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, ...@@ -739,6 +739,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
index &= 0xff; index &= 0xff;
switch (requesttype & USB_RECIP_MASK) { switch (requesttype & USB_RECIP_MASK) {
case USB_RECIP_ENDPOINT: case USB_RECIP_ENDPOINT:
if ((index & ~USB_DIR_IN) == 0)
return 0;
ret = findintfep(ps->dev, index); ret = findintfep(ps->dev, index);
if (ret >= 0) if (ret >= 0)
ret = checkintf(ps, ret); ret = checkintf(ps, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment