From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>,
liulongfang <liulongfang@huawei.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB:bugfix a controller halt error
Date: Mon, 24 Jul 2023 14:35:23 +0200 [thread overview]
Message-ID: <c586a9c4-a51e-b870-c2c3-b0c7ffec0064@suse.com> (raw)
In-Reply-To: <c3ab029f-f6ab-4b09-b2b5-1cc6a5370d0d@rowland.harvard.edu>
On 21.07.23 16:57, Alan Stern wrote:
> There is a flaw in your reasoning.
>
> The operation carried out here is deliberately unsafe (for full-speed
> devices). It is made before we know the actual maxpacket size for ep0,
> and as a result it might return an error code even when it works okay.
> This shouldn't happen, but a lot of USB hardware is unreliable.
>
> Therefore we must not ignore the result merely because r < 0. If we do
> that, the kernel might stop working with some devices.
Right. However, we must make sure we are operating on controlled results.
As is we are operating on a random buffer without checking an IO operation
has been performed on it.
Regards
Oliver
next prev parent reply other threads:[~2023-07-24 12:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 10:00 liulongfang
2023-07-21 11:08 ` Greg KH
2023-07-26 6:44 ` liulongfang
2023-07-26 7:18 ` Greg KH
2023-07-26 11:16 ` Oliver Neukum
2023-07-27 7:00 ` liulongfang
2023-07-27 8:46 ` Oliver Neukum
2023-07-27 4:02 ` liulongfang
2023-07-21 14:57 ` Alan Stern
2023-07-24 12:35 ` Oliver Neukum [this message]
2023-07-26 6:58 ` liulongfang
2023-07-26 14:20 ` Alan Stern
2023-07-27 7:03 ` liulongfang
2023-07-27 8:47 ` Oliver Neukum
2023-07-27 14:42 ` Alan Stern
2023-07-27 15:31 ` Oliver Neukum
2023-07-27 15:57 ` Alan Stern
2023-08-10 1:20 ` liulongfang
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=c586a9c4-a51e-b870-c2c3-b0c7ffec0064@suse.com \
--to=oneukum@suse.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=stern@rowland.harvard.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®