linux/drivers/usb
Gustavo A. R. Silva 9ae24af366 usb: gadget: storage: Fix Spectre v1 vulnerability
num can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/usb/gadget/function/f_mass_storage.c:3177 fsg_lun_make() warn:
potential spectre issue 'fsg_opts->common->luns' [r] (local cap)

Fix this by sanitizing num before using it to index
fsg_opts->common->luns

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Felipe Balbi <felipe.balbi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-17 20:57:55 +02: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 Merge 4.18-rc7 into usb-next 2018-07-30 10:04:58 +02:00
class cdc-acm: correct counting of UART states in serial state notification 2018-10-09 16:13:42 +02:00
common usb: roles: Take care of driver module reference counting 2018-09-20 13:20:24 +02:00
core USB: fix the usbfs flag sanitization for control transfers 2018-10-16 13:09:36 +02:00
dwc2 usb: dwc2: Fix call location of dwc2_check_core_endianness 2018-09-05 13:12:31 +03:00
dwc3 usb: fixes for v4.19-rc2 2018-09-06 11:21:54 +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: storage: Fix Spectre v1 vulnerability 2018-10-17 20:57:55 +02:00
host usb: xhci: pci: Enable Intel USB role mux on Apollo Lake platforms 2018-10-09 16:13:50 +02:00
image USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
isp1760 usb: isp1760: remove redundant variable 'selector' 2018-07-13 15:41:56 +02:00
misc usb: misc: uss720: Fix two sleep-in-atomic-context bugs 2018-09-05 14:36:53 +02:00
mon USB: mon: use ktime_get_real_ts64 instead of getnstimeofday64 2018-06-25 21:58:26 +08:00
mtu3 usb: mtu3: fix error of xhci port id when enable U3 dual role 2018-09-05 13:27:07 +02:00
musb usb: musb: dsps: do not disable CPPI41 irq in driver teardown 2018-09-20 12:40:14 +02:00
phy usb/phy: fix PPC64 build errors in phy-fsl-usb.c 2018-07-21 08:15:12 +02:00
renesas_usbhs usb: renesas_usbhs: Kconfig: convert to SPDX identifiers 2018-07-30 15:27:14 +02:00
roles usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable 2018-10-09 16:13:42 +02:00
serial USB: serial: simple: add Motorola Tetra MTP6550 id 2018-09-24 15:30:16 +02:00
storage usb: uas: add support for more quirk flags 2018-09-05 13:27:07 +02:00
typec usb: typec: mux: Take care of driver module reference counting 2018-09-20 13:35:01 +02:00
usbip usb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control() 2018-10-09 16:13:42 +02:00
wusbcore usb: wusbcore: security: cast sizeof to int for comparison 2018-07-02 18:08:19 +02:00
Kconfig usb: select USB_COMMON for usb role switch config 2018-04-22 15:23:37 +02:00
Makefile usb: roles: Add Intel xHCI USB role switch driver 2018-03-22 13:49:27 +01:00
README
usb-skeleton.c usb: usb-skeleton: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09: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.