android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yoshihiro Shimoda b94afae0fa usb: gadget: udc: renesas_usb3: Fix a race in usb3_start_pipen()
commit e752dbc59e1241b13b8c4f7b6eb582862e7668fe upstream.

The usb3_start_pipen() is called by renesas_usb3_ep_queue() and
usb3_request_done_pipen() so that usb3_start_pipen() is possible
to cause a race when getting usb3_first_req like below:

renesas_usb3_ep_queue()
 spin_lock_irqsave()
 list_add_tail()
 spin_unlock_irqrestore()
 usb3_start_pipen()
  usb3_first_req = usb3_get_request() --- [1]
 --- interrupt ---
 usb3_irq_dma_int()
 usb3_request_done_pipen()
  usb3_get_request()
  usb3_start_pipen()
  usb3_first_req = usb3_get_request()
  ...
  (the req is possible to be finished in the interrupt)

The usb3_first_req [1] above may have been finished after the interrupt
ended so that this driver caused to start a transfer wrongly. To fix this
issue, getting/checking the usb3_first_req are under spin_lock_irqsave()
in the same section.

Fixes: 746bfe63bb ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: stable <[email protected]>
Signed-off-by: Yoshihiro Shimoda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-06-03 08:59:05 +02:00
..
atm
c67x00
cdns3
chipidea
class cdc-wdm: untangle a circular dependency between callback and softint 2021-05-19 10:08:31 +02:00
common
core USB: usbfs: Don't WARN about excessively large memory allocations 2021-06-03 08:59:04 +02:00
dwc2 usb: dwc2: Fix gadget DMA unmap direction 2021-05-19 10:08:31 +02:00
dwc3 usb: dwc3: gadget: Properly track pending and queued SG 2021-06-03 08:59:05 +02:00
early
gadget usb: gadget: udc: renesas_usb3: Fix a race in usb3_start_pipen() 2021-06-03 08:59:05 +02:00
host usb: sl811-hcd: improve misleading indentation 2021-05-22 11:38:27 +02:00
image
isp1760
misc USB: trancevibrator: fix control-request direction 2021-06-03 08:59:04 +02:00
mon
mtu3
musb usb: musb: fix PM reference leak in musb_irq_work() 2021-05-11 14:04:07 +02:00
phy
renesas_usbhs usb: renesas_usbhs: Clear PIPECFG for re-enabling pipe with other EPNUM 2021-03-17 17:03:50 +01:00
roles
serial USB: serial: pl2303: add device id for ADLINK ND-6530 GC 2021-06-03 08:59:05 +02:00
storage usb-storage: Add quirk to defeat Kindle's automatic unload 2021-03-24 11:26:40 +01:00
typec usb: typec: tcpm: Fix error while calculating PPS out values 2021-05-19 10:08:33 +02:00
usbip usbip: vudc: fix missing unlock on error in usbip_sockfd_store() 2021-05-14 09:44:22 +02:00
Kconfig
Makefile
usb-skeleton.c