tom.leiming@gmail.com 0956a8c20b usbnet: increase URB reference count before usb_unlink_urb
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@kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-22 19:32:34 -04:00
..
2012-03-08 10:50:35 -08:00
2012-03-21 10:37:25 -07:00
2012-03-20 11:16:20 -07:00
2012-03-21 10:34:56 -07:00
2012-03-20 11:24:39 -07:00
2012-03-21 10:15:51 -07:00
2012-02-01 19:35:21 +01:00
2012-03-17 01:41:43 -07:00
2012-03-21 10:34:56 -07:00
2012-03-21 21:57:36 -04:00
2012-03-21 10:32:00 -07:00
2012-03-20 11:26:30 -07:00
2012-03-04 23:11:14 +01:00
2012-02-08 16:58:04 -08:00