]> git.hungrycats.org Git - linux/commit
[PATCH] USB: Don't trust raw descriptor length in devioc.
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 25 Mar 2004 09:06:47 +0000 (01:06 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 25 Mar 2004 09:06:47 +0000 (01:06 -0800)
commit5994187764a9ea2a41b26450b74fa53b0970aea1
tree1b430c6e64bdba9a5c8704ab8b7eb5ecf810fd2f
parentaf6f5064170ebb6472c9d21928b58d324ae9e544
[PATCH] USB: Don't trust raw descriptor length in devioc.

This is a very minor point, unlikely ever to come up.  But just in case...

It's conceivable that a device might transmit different values for a
configuration descriptor's wTotalLength the first time we ask for it (in
order to get the length) and the second time (to get the entire
descriptor).  Should that improbable event occur, the rawdescriptor buffer
could be allocated using a size that's smaller than the length recorded in
the rawdescriptor itself.  This patch protects devio.c against such a
problem.

If you feel this sequence of events is too unlikely to worry about, then
don't bother to apply the patch.
drivers/usb/core/devio.c