linux/drivers/usb/core
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
..
buffer.c
config.c USB: usb_parse_endpoint: ignore reserved bits 2024-05-03 07:35:37 +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 usb: usb_autopm_get_interface use modern helper 2024-01-27 16:43:48 -08: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 kcov, usb: disable interrupts in kcov_remote_start_usb_softirq 2024-06-04 15:34:44 +02:00
hub.c Linux 6.9-rc7 2024-05-10 09:38:01 +01:00
hub.h Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +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
of.c usb: core: Set connect_type of ports based on DT node 2024-03-05 13:28:46 +00:00
otg_productlist.h
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: Fix access violation during port device removal 2024-04-23 16:25:49 -07:00
quirks.c usb: new quirk to reduce the SET_ADDRESS request timeout 2023-11-23 12:32:44 +00:00
sysfs.c USB: core: Fix deadlock in usb_deauthorize_interface() 2024-03-26 11:02:47 +01:00
urb.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
usb-acpi.c usb: usb-acpi: Fix oops due to freeing uninitialized pld pointer 2024-03-19 13:07:35 +01:00
usb.c usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00
usb.h usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00