mirror_ubuntu-kernels/drivers/usb
Andrey Konovalov f85d39dd7e kcov, usb: disable interrupts in kcov_remote_start_usb_softirq
After commit 8fea0c8fda ("usb: core: hcd: Convert from tasklet to BH
workqueue"), usb_giveback_urb_bh() runs in the BH workqueue with
interrupts enabled.

Thus, the remote coverage collection section in usb_giveback_urb_bh()->
__usb_hcd_giveback_urb() might be interrupted, and the interrupt handler
might invoke __usb_hcd_giveback_urb() again.

This breaks KCOV, as it does not support nested remote coverage collection
sections within the same context (neither in task nor in softirq).

Update kcov_remote_start/stop_usb_softirq() to disable interrupts for the
duration of the coverage collection section to avoid nested sections in
the softirq context (in addition to such in the task context, which are
already handled).

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Closes: https://lore.kernel.org/linux-usb/0f4d1964-7397-485b-bc48-11c01e2fcbca@I-love.SAKURA.ne.jp/
Closes: https://syzkaller.appspot.com/bug?extid=0438378d6f157baae1a2
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: 8fea0c8fda ("usb: core: hcd: Convert from tasklet to BH workqueue")
Cc: stable@vger.kernel.org
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20240527173538.4989-1-andrey.konovalov@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-04 15:34:44 +02:00
..
atm usb: ueagle-atm: Use wait_event_freezable_timeout() in uea_wait() 2024-01-04 15:57:29 +01:00
c67x00 USB: c67x00: Remove unused declaration c67x00_hcd_msg_received() 2023-10-02 16:42:33 +02:00
cdns3 tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
chipidea Revert "usb: chipidea: move ci_ulpi_init after the phy initialization" 2024-06-04 14:51:09 +02:00
class Revert "usb: cdc-wdm: close race between read and workqueue" 2024-04-18 16:33:28 +02:00
common usb: ulpi: Fix debugfs directory leak 2024-01-27 17:41:42 -08:00
core kcov, usb: disable interrupts in kcov_remote_start_usb_softirq 2024-06-04 15:34:44 +02:00
dwc2 Merge 6.9-rc5 into usb-next 2024-04-23 13:33:26 +02:00
dwc3 tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
early usb: early: xhci-dbc: Use memcpy_and_pad() 2023-01-31 10:40:54 +01:00
fotg210 usb: fotg210: Add missing kernel doc description 2024-05-11 08:42:03 +01:00
gadget tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
host Linux 6.9-rc7 2024-05-10 09:38:01 +01:00
image scsi: core: Add a dma_alignment field to the host and host template 2024-04-11 21:37:48 -04:00
isp1760 mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
misc USB: fix up for "usb: misc: onboard_hub: rename to onboard_dev" 2024-04-30 18:11:13 +02:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-05 10:36:08 +01:00
mtu3 tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
musb tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
phy usb: phy-generic: add short delay after pulling the reset pin 2024-04-09 17:37:35 +02:00
renesas_usbhs usb: renesas_usbhs: Remove renesas_usbhs_get_info() wrapper 2024-04-18 16:47:49 +02:00
roles Merge v6.8-rc6 into usb-next 2024-02-26 06:53:50 +01:00
serial USB: serial: option: add Telit FN920C04 rmnet compositions 2024-04-18 17:14:49 +02:00
storage SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
typec usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state 2024-06-04 15:34:12 +02:00
usbip USB: core: Use device_driver directly in struct usb_driver and usb_device_driver 2024-01-04 16:06:32 +01:00
Kconfig usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
Makefile USB: xen-hcd: Traverse host/ when CONFIG_USB_XEN_HCD is selected 2024-06-04 15:33:38 +02:00
usb-skeleton.c