linux/drivers/usb
Gustavo A. R. Silva 225b3dc92d USB: wusbcore: crypto: Remove VLA usage
In preparation to enabling -Wvla, remove VLA and replace it
with dynamic memory allocation instead.

The use of stack Variable Length Arrays needs to be avoided, as they
can be a vector for stack exhaustion, which can be both a runtime bug
or a security flaw. Also, in general, as code evolves it is easy to
lose track of how big a VLA can get. Thus, we can end up having runtime
failures that are hard to debug.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Notice that in this particular case, an alternative to kzalloc is kcalloc,
in which case the code would look as follows instead:

iv = kcalloc(crypto_skcipher_ivsize(tfm_cbc), sizeof(*iv), GFP_KERNEL);

but if the data type of _iv_ never changes, or the type size is always one
byte, kzalloc is good enough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-16 15:40:19 +01:00
..
atm USB: atm: fix up some remaining DEVICE_ATTR() usage 2018-01-24 08:49:52 +01:00
c67x00 USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
chipidea usb: add a flag to skip PHY initialization to struct usb_hcd 2018-03-09 09:43:52 -08:00
class usb: cdc_acm: prevent race at write to acm while system resumes 2018-02-16 07:52:55 +01:00
common USB: ulpi: fix bus-node lookup 2017-11-28 15:17:48 +01:00
core Revert "usb: core: Add "quirks" parameter for usbcore" 2018-03-12 16:30:40 +01:00
dwc2 USB: dwc2: Re-use DEFINE_SHOW_ATTRIBUTE() macro 2018-03-09 09:27:55 -08:00
dwc3 usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume 2018-02-15 15:28:35 +02:00
early usb: early: Correct the endpoint type value for bulk in endpoint 2017-12-07 16:03:15 +01:00
gadget USB: gadget: pxa27x: Re-use DEFINE_SHOW_ATTRIBUTE() macro 2018-03-09 09:31:25 -08:00
host USB: host: sl811: Re-use DEFINE_SHOW_ATTRIBUTE() macro 2018-03-16 15:40:19 +01:00
image USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
isp1760 usb: isp1760: Use kasprintf 2018-03-09 09:40:21 -08:00
misc USB: adutux: Add waiting in transfer abortion 2018-03-09 09:37:10 -08:00
mon vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
mtu3 usb: mtu3: fix semicolon.cocci warnings 2018-01-16 10:01:01 +01:00
musb USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro 2018-03-09 09:27:55 -08:00
phy usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28 2018-02-12 10:51:37 +02:00
renesas_usbhs usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path 2018-02-15 18:43:57 +01:00
serial USB: serial: option: Add support for Quectel EP06 2018-02-15 18:36:19 +01:00
storage USB: move many drivers to use DEVICE_ATTR_RO 2018-01-24 08:49:52 +01:00
typec usb: typec: Start using ERR_PTR 2018-03-09 09:46:18 -08:00
usbip usbip: Correct maximum value of CONFIG_USBIP_VHCI_HC_PORTS 2018-03-09 09:16:18 -08:00
wusbcore USB: wusbcore: crypto: Remove VLA usage 2018-03-16 15:40:19 +01:00
Kconfig sparc,leon: Select USB_UHCI_BIG_ENDIAN_{MMIO,DESC} 2018-02-15 21:45:16 +00:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
README
usb-skeleton.c usb: usb-skeleton: make MODULE_LICENSE and SPDX tag match 2018-03-06 09:42:07 -08:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.