projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4f8843
)
usbip: vhci_hcd: fix calling usb_hcd_giveback_urb() with irqs enabled
author
Shuah Khan
<skhan@linuxfoundation.org>
Tue, 6 Oct 2020 22:39:14 +0000
(16:39 -0600)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 7 Oct 2020 07:25:48 +0000
(09:25 +0200)
kcov testing uncovered call to usb_hcd_giveback_urb() without disabling
interrupts.
Link:
https://lore.kernel.org/linux-usb/CAAeHK+wb4k-LGTjK9F5YbJNviF_+yU+wE_=Vpo9Rn7KFN8vG6Q@mail.gmail.com/
usb_hcd_giveback_urb() is called from vhci's urb_enqueue, when it
determines it doesn't need to xmit the urb and can give it back.
This path runs in task context.
Disable irqs around usb_hcd_giveback_urb() call.
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Link:
https://lore.kernel.org/r/20201006223914.39257-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/vhci_hcd.c
patch
|
blob
|
history
diff --git
a/drivers/usb/usbip/vhci_hcd.c
b/drivers/usb/usbip/vhci_hcd.c
index 1b598db5d8b9ddb49e101fdcf62316bb0cbd4df7..66cde5e5f7964a597bc802b8e7718c5677d42bde 100644
(file)
--- a/
drivers/usb/usbip/vhci_hcd.c
+++ b/
drivers/usb/usbip/vhci_hcd.c
@@
-797,8
+797,14
@@
no_need_xmit:
usb_hcd_unlink_urb_from_ep(hcd, urb);
no_need_unlink:
spin_unlock_irqrestore(&vhci->lock, flags);
- if (!ret)
+ if (!ret) {
+ /* usb_hcd_giveback_urb() should be called with
+ * irqs disabled
+ */
+ local_irq_disable();
usb_hcd_giveback_urb(hcd, urb, urb->status);
+ local_irq_enable();
+ }
return ret;
}