No description
Find a file
Alan Stern 1389062650 USB: core: Add routines for endpoint checks in old drivers
Many of the older USB drivers in the Linux USB stack were written
based simply on a vendor's device specification.  They use the
endpoint information in the spec and assume these endpoints will
always be present, with the properties listed, in any device matching
the given vendor and product IDs.

While that may have been true back then, with spoofing and fuzzing it
is not true any more.  More and more we are finding that those old
drivers need to perform at least a minimum of checking before they try
to use any endpoint other than ep0.

To make this checking as simple as possible, we now add a couple of
utility routines to the USB core.  usb_check_bulk_endpoints() and
usb_check_int_endpoints() take an interface pointer together with a
list of endpoint addresses (numbers and directions).  They check that
the interface's current alternate setting includes endpoints with
those addresses and that each of these endpoints has the right type:
bulk or interrupt, respectively.

Although we already have usb_find_common_endpoints() and related
routines meant for a similar purpose, they are not well suited for
this kind of checking.  Those routines find endpoints of various
kinds, but only one (either the first or the last) of each kind, and
they don't verify that the endpoints' addresses agree with what the
caller expects.

In theory the new routines could be more general: They could take a
particular altsetting as their argument instead of always using the
interface's current altsetting.  In practice I think this won't matter
too much; multiple altsettings tend to be used for transferring media
(audio or visual) over isochronous endpoints, not bulk or interrupt.
Drivers for such devices will generally require more sophisticated
checking than these simplistic routines provide.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/dd2c8e8c-2c87-44ea-ba17-c64b97e201c9@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-20 11:43:22 +02:00
arch ARM: dts: stm32: add USB OTG UTMI clock on stm32mp151 2023-04-20 10:17:06 +02:00
block block: don't set GD_NEED_PART_SCAN if scan partition failed 2023-04-06 20:41:53 -06:00
certs
crypto
Documentation dt-bindings: usb: snps,dwc3: Add 'snps,parkmode-disable-hs-quirk' quirk 2023-04-20 11:18:12 +02:00
drivers USB: core: Add routines for endpoint checks in old drivers 2023-04-20 11:43:22 +02:00
fs two cifs/smb3 client fixes, one for stable 2023-04-08 18:37:45 -07:00
include USB: core: Add routines for endpoint checks in old drivers 2023-04-20 11:43:22 +02:00
init
io_uring io_uring-6.3-2023-04-06 2023-04-08 11:34:17 -07:00
ipc
kernel - Fix "same task" check when redirecting event output 2023-04-09 10:10:46 -07:00
lib
LICENSES
mm
net Including fixes from wireless and can. 2023-04-06 11:39:07 -07:00
rust
samples
scripts
security
sound
tools 28 hotfixes. 2023-04-08 10:51:12 -07:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 6.3-rc6 2023-04-09 11:15:57 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.