From: Shuah Khan <skhan@linuxfoundation.org>
To: Muhammad Usama Anjum <musamaanjum@gmail.com>,
shuah@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
valentina.manea.m@gmail.com, stern@rowland.harvard.edu,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] usbip: vhci_hcd: do proper error handling
Date: Thu, 8 Apr 2021 09:44:45 -0600 [thread overview]
Message-ID: <0ff0a28a-e369-91c8-81f9-c6e2cbe4bc26@linuxfoundation.org> (raw)
In-Reply-To: <65e6931b2a15e4685eb0c3b7873a197ba025d50d.camel@gmail.com>
On 3/31/21 5:23 AM, Muhammad Usama Anjum wrote:
> On Fri, 2021-03-26 at 14:24 -0600, Shuah Khan wrote:
>> On 3/25/21 5:46 AM, Muhammad Usama Anjum wrote:
>>> The driver was assuming that all the parameters would be valid. But it
>>> is possible that parameters are sent from userspace. For those cases,
>>> appropriate error checks have been added.
>>>
>>
>> Are you sure this change is necessary for vhci_hcd? Is there a
>> scenario where vhci_hcd will receive these values from userspace?
> I'm not sure if these changes are necessary for vhci_hcd. I'd sent
> this patch following the motivation of a patch (c318840fb2) from
> dummy_hcd to handle some cases. Yeah, there is scenario where vhci_hcd
> will receive these values from userspace. For example, typReq =
> SetPortFeature and wValue = USB_PORT_FEAT_C_CONNECTION can be received
> from userspace. As USB_PORT_FEAT_C_CONNECTION case isn't being
> handled, default case will is executed for it. So I'm assuming
> USB_PORT_FEAT_C_CONNECTION isn't supported and default case shouldn't
> be executed.
>
The way dummy_hcd handles USB_PORT_FEAT_C_CONNECTION isn't applicable
to vhci_hcd.
rh_port_connect() and rh_port_disconnect() set the
USB_PORT_FEAT_C_CONNECTION this flag to initiate port status polling.
This flag is set by the driver as a result of attach/deatch request
from the user-space. Current handling of this flag is correct.
>> Is there a way to reproduce the problem?
> I'm not able to reproduce any problem. But typReq = SetPortFeature and
> wValue = USB_PORT_FEAT_C_CONNECTION may trigger some behavior which
> isn't intended as USB_PORT_FEAT_C_CONNECTION may not be supported for
> vhci_hcd.
>
If you reproduce the problem and it impacts attach/detach and device
remote device access, we can to look into this further.
thanks,
-- Shuah
prev parent reply other threads:[~2021-04-08 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 11:46 [PATCH] usbip: vhci_hcd: do proper error handling Muhammad Usama Anjum
2021-03-26 20:24 ` Shuah Khan
2021-03-31 11:23 ` Muhammad Usama Anjum
2021-04-08 15:44 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ff0a28a-e369-91c8-81f9-c6e2cbe4bc26@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=musamaanjum@gmail.com \
--cc=shuah@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=valentina.manea.m@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.