linux/drivers/usb/storage
Syed Labeeq Sajid Bukhari 8a0200d14a usb: storage: sierra_ms: reject short SWoC info transfers
sierra_get_swoc_info() requests sizeof(struct swoc_info) (60) bytes
from the device via usb_control_msg(), but its callers only treat a
negative return value as failure. A device that answers the
vendor-specific GetSwocInfo request with a short IN transfer is
therefore accepted, leaving the tail of the freshly allocated
(kmalloc(), non-zeroing) swoc_info buffer uninitialized.

truinst_show() subsequently prints swocInfo->rev, swocInfo->LinuxSKU
and swocInfo->LinuxVer from that buffer into the world-readable
(0444) "truinst" sysfs attribute. An emulated/malicious USB device
(VID 0x1199, PID 0x0fff) can exploit this to disclose up to 5 bytes
of stale kernel heap memory (kmalloc-64) to unprivileged userspace,
once per sysfs read, indefinitely. On kernels built without
init_on_alloc this leaks recently freed heap contents.

Only accept the transfer when the full structure was received.
sierra_ms_init() already retries failed queries, so well-behaved
devices are unaffected.

Fixes: 32fe5e3934 ("USB Storage Sierra: TRU-Install feature update")
Cc: stable <stable@kernel.org>
Signed-off-by: Syed Labeeq Sajid Bukhari <syedlabeeq@gmail.com>
Assisted-by: Kimi:K2 [Kimi Code CLI]
Link: https://patch.msgid.link/20260910140343.49371-1-syedlabeeq@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-09-10 17:08:52 +02:00
..
alauda.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
cypress_atacb.c
datafab.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
debug.c
debug.h
ene_ub6250.c usb-storage: ene_ub6250: fix race between scan work and probe 2026-09-01 16:43:32 +02:00
freecom.c
initializers.c
initializers.h
isd200.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
jumpshot.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
karma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
Kconfig
Makefile
onetouch.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
option_ms.c
option_ms.h
protocol.c drivers/usb/storage: use min() instead of min_t() 2025-11-21 15:17:24 +01:00
protocol.h
realtek_cr.c usb: storage: realtek_cr: fix use-after-free on disconnect 2026-09-01 16:48:45 +02:00
scsiglue.c scsi: Change the return type of the .queuecommand() callback 2026-01-23 21:32:34 -05:00
scsiglue.h
sddr09.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sddr55.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
shuttle_usbat.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sierra_ms.c usb: storage: sierra_ms: reject short SWoC info transfers 2026-09-10 17:08:52 +02:00
sierra_ms.h
transport.c usb: storage: Fix memory leak in USB bulk transport 2025-11-09 10:56:05 +09:00
transport.h
uas-detect.h
uas.c USB: uas: give the error handler the correct name 2026-03-18 16:01:09 +01:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h USB: storage: add NO_ATA_1X quirk for Longmai USB Key 2026-07-16 17:11:02 +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 usb: storage: Add quirks for PNY Elite Portable SSD 2026-05-22 11:12:47 +02:00
unusual_usbat.h
usb.c USB: storage: include US_FL_NO_SAME in quirks mask 2026-06-25 15:11:05 +01:00
usb.h
usual-tables.c