alistair23-linux/drivers/usb/gadget
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
..
function usb: gadget: storage: Fix Spectre v1 vulnerability 2018-10-17 20:57:55 +02:00
legacy usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" 2018-07-26 13:35:29 +03:00
udc usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0 2018-08-29 10:00:30 +03:00
composite.c usb: gadget: Fix OS descriptors support 2018-07-17 10:12:51 +03:00
config.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
configfs.c usb: gadget: configfs: avoid spaces for indentation 2018-07-26 13:49:49 +03:00
configfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
epautoconf.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
functions.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
Kconfig Revert "usb: gadget: allow to enable legacy drivers without USB_ETH" 2017-12-12 12:48:30 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
u_f.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
u_f.h USB: gadget: f_midi: fixing a possible double-free in f_midi 2018-03-26 11:53:14 +02:00
u_os_desc.h USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
usbstring.c usb/gadget: Constify usb_gadget_get_string "table" argument 2018-05-15 10:06:49 +03:00