linux_dsm_epyc7002/drivers/usb/storage
Alan Stern 786de92b3c USB: uas: fix bug in handling of alternate settings
The uas driver has a subtle bug in the way it handles alternate
settings.  The uas_find_uas_alt_setting() routine returns an
altsetting value (the bAlternateSetting number in the descriptor), but
uas_use_uas_driver() then treats that value as an index to the
intf->altsetting array, which it isn't.

Normally this doesn't cause any problems because the various
alternate settings have bAlternateSetting values 0, 1, 2, ..., so the
value is equal to the index in the array.  But this is not guaranteed,
and Andrey Konovalov used the syzkaller fuzzer with KASAN to get a
slab-out-of-bounds error by violating this assumption.

This patch fixes the bug by making uas_find_uas_alt_setting() return a
pointer to the altsetting entry rather than either the value or the
index.  Pointers are less subject to misinterpretation.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
CC: Oliver Neukum <oneukum@suse.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-22 18:29:00 +02:00
..
alauda.c
cypress_atacb.c
datafab.c
debug.c
debug.h
ene_ub6250.c
freecom.c
initializers.c
initializers.h
isd200.c
jumpshot.c
karma.c
Kconfig
Makefile
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c USB: realtek_cr: remove unneeded MODULE_VERSION() usage 2017-07-22 15:56:53 +02:00
scsiglue.c
scsiglue.h
sddr09.c
sddr55.c
shuttle_usbat.c
sierra_ms.c
sierra_ms.h
transport.c usb-storage: fix bogus hardware error messages for ATA pass-thru devices 2017-09-22 10:08:50 +02:00
transport.h
uas-detect.h USB: uas: fix bug in handling of alternate settings 2017-09-22 18:29:00 +02:00
uas.c USB: uas: fix bug in handling of alternate settings 2017-09-22 18:29:00 +02:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h usb-storage: unusual_devs entry to fix write-access regression for Seagate external drives 2017-09-22 10:08:50 +02:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069 2017-07-30 07:18:27 -07:00
unusual_usbat.h
usb.c usb-storage: fix deadlock involving host lock and scsi_done 2017-07-30 07:18:27 -07:00
usb.h
usual-tables.c