From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: Use well-known descriptor sizes when parsing configuration
Date: Sat, 13 Jul 2013 09:23:31 +0200 [thread overview]
Message-ID: <20130713092331.2643ba0e@lilith> (raw)
In-Reply-To: <1373675416-21559-1-git-send-email-jwerner@chromium.org>
Hi Julius,
On Fri, 12 Jul 2013 17:30:16 -0700, Julius Werner
<jwerner@chromium.org> wrote:
> The existing USB configuration parsing code relies on the descriptors'
> own length values when reading through the configuration blob. Since the
> size of those descriptors is always well-defined, we should rather use
> the known sizes instead of trusting device-provided values to be
> correct. Also adds some safety to potential out-of-order descriptors.
Question from the offspring of an USB ignoramus and a Devil's advocate:
if the device, rather than relying on well-known sizes, provides its
own values for lengths, maybe it's because it will let you read or write
only that much, and if you try to read more, you might put the device
in an unclean, or worse, non-functional, state?
In that case, trying to read a well-known length instead could cause
more issues than reading the device-maker-specified length, could it
not?
BTW, what is the real-world issue (hardware, conditions, expected
outcome, actual outcome) which made this change needed?
Amicalement,
--
Albert.
prev parent reply other threads:[~2013-07-13 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-13 0:30 [U-Boot] [PATCH] usb: Use well-known descriptor sizes when parsing configuration Julius Werner
2013-07-13 7:23 ` Albert ARIBAUD [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=20130713092331.2643ba0e@lilith \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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