Thread (1 message) 1 message, 1 author, 2012-03-22

Re: [PATCH 1/2] usbnet: increase URB reference count before usb_unlink_urb

From: David Miller <hidden>
Date: 2012-03-22 23:33:36

From: Greg Kroah-Hartman <redacted>
Date: Thu, 22 Mar 2012 07:35:53 -0700
On Thu, Mar 22, 2012 at 09:22:18PM +0800, Ming Lei wrote:
quoted
Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
recursive locking in usbnet_stop()) fixes the recursive locking
problem by releasing the skb queue lock, but it makes usb_unlink_urb
racing with defer_bh, and the URB to being unlinked may be freed before
or during calling usb_unlink_urb, so use-after-free problem may be
triggerd inside usb_unlink_urb.

The patch fixes the use-after-free problem by increasing URB
reference count with skb queue lock held before calling
usb_unlink_urb, so the URB won't be freed until return from
usb_unlink_urb.

Cc: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: Sebastian Andrzej Siewior <redacted>
Cc: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Oliver Neukum <redacted>
Reported-by: Dave Jones <redacted>
Signed-off-by: Ming Lei <redacted>
Acked-by: Greg Kroah-Hartman <redacted>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help