linux/drivers/usb/core
Xu Yang b0cdcacd91 usb: core: hcd: fix accessing unmapped memory in SINGLE_STEP_SET_FEATURE test
commit 8fe06185e1 upstream.

The USB core will unmap urb->transfer_dma after SETUP stage completes.
Then the USB controller will access unmapped memory when it received
device descriptor. If iommu is equipped, the entire test can't be
completed due to the memory accessing is blocked.

Fix it by calling map_urb_for_dma() again for IN stage. To reduce
redundant map for urb->transfer_buffer, this will also set
URB_NO_TRANSFER_DMA_MAP flag before first map_urb_for_dma() to skip
dma map for urb->transfer_buffer and clear URB_NO_TRANSFER_DMA_MAP
flag before second map_urb_for_dma().

Fixes: 216e0e563d ("usb: core: hcd: use map_urb_for_dma for single step set feature urb")
Cc: stable <stable@kernel.org>
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250806083955.3325299-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-08-28 16:31:09 +02:00
..
buffer.c - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
config.c usb: core: config: Prevent OOB read in SS endpoint companion parsing 2025-08-20 18:30:52 +02:00
devices.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
devio.c usb: convert to new timestamp accessors 2023-10-18 13:26:17 +02:00
driver.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
endpoint.c usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00
file.c USB: make usb class a const structure 2023-07-25 17:49:30 +02:00
generic.c usb: core: Fix crash w/ usb_choose_configuration() if no driver 2023-12-15 13:54:09 +01:00
hcd-pci.c usb: hcd-pci: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY 2024-04-25 12:53:30 -05:00
hcd.c usb: core: hcd: fix accessing unmapped memory in SINGLE_STEP_SET_FEATURE test 2025-08-28 16:31:09 +02:00
hub.c usb: hub: Don't try to recover devices lost during warm reset. 2025-07-24 08:56:36 +02:00
hub.h usb: hub: Fix flushing of delayed work used for post resume purposes 2025-07-24 08:56:36 +02:00
Kconfig usb: core: Kconfig: Improve USB authorization mode help 2024-02-17 16:38:35 +01:00
ledtrig-usbport.c usb: core: Use module_led_trigger macro to simplify the code 2023-08-22 14:44:23 +02:00
Makefile usb: misc: onboard_hub: rename to onboard_dev 2024-03-27 07:57:16 +01:00
message.c USB: document some API requirements on disconnection 2024-03-02 20:37:14 +01:00
notify.c USB: core: Remove usbfs_mutex 2019-06-26 10:28:09 +08:00
of.c usb: core: add missing of_node_put() in usb_of_has_devices_or_graph 2024-07-03 16:04:10 +02:00
otg_productlist.h USB: OTG: rename product list of devices 2020-06-19 08:58:55 +02:00
phy.c usb: core: add phy notify connect and disconnect 2024-01-27 17:36:14 -08:00
phy.h usb: core: add phy notify connect and disconnect 2024-01-27 17:36:14 -08:00
port.c USB: core: Disable LPM only for non-suspended ports 2025-01-17 13:40:54 +01:00
quirks.c usb: quirks: Add DELAY_INIT quick for another SanDisk 3.2Gen1 Flash Drive 2025-08-28 16:31:09 +02:00
sysfs.c usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes() 2024-08-22 17:29:50 +08:00
urb.c usb: core: usb_submit_urb: downgrade type check 2025-08-20 18:30:27 +02:00
usb-acpi.c usb: acpi: fix device link removal 2025-07-10 16:05:11 +02:00
usb.c usb: Add checks for snprintf() calls in usb_alloc_dev() 2025-07-06 11:01:35 +02:00
usb.h usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00