usbnet: don't clear urb->dev in tx_complete
PATCH 2/2 usbnet: don't clear urb->dev in tx_complete
URB unlinking is always racing with its completion and tx_complete may be called before or during running usb_unlink_urb, so tx_complete must not clear urb->dev since it will be used in unlink path, otherwise invalid memory accesses or usb device leak may be caused inside usb_unlink_urb.
--- drivers/net/usb/usbnet.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/usb/usbnet.c +0 -1
@@ -1037,7 +1037,6 @@ static void tx_complete (struct urb *urb) }usb_autopm_put_interface_async (dev->intf); - urb->dev =NULL ; entry->state = tx_done;defer_bh (dev, skb, &dev->txq); }
Signature · 1 line
1.7.9.1
Quoted 10 lines · Ming Lei
URB unlinking is always racing with its completion and
tx_completemay be called before or during runningusb_unlink_urb, sotx_completemust not clearurb->devsince it will be used in unlink path, otherwise invalid memory accesses or usb device leak may be caused insideusb_unlink_urb.Cc Alan Stern <[email protected]>Cc Oliver Neukum <[email protected]>Signed-off-by Ming Lei <[email protected]>
From: Greg Kroah-Hartman <[email protected]>
Date: Thu, 22 Mar 2012 07:36:07 -0700
Quoted 7 lines · Ming Lei
Quoted 6 lines
URB unlinking is always racing with its completion and
tx_completemay be called before or during runningusb_unlink_urb, sotx_completemust not clearurb->devsince it will be used in unlink path, otherwise invalid memory accesses or usb device leak may be caused insideusb_unlink_urb.
Quoted 6 lines
Quoted 4 lines
Cc Alan Stern <stern-nwvwT67g6+6dFdvTe/[email protected]>Cc Oliver Neukum <[email protected]>Signed-off-by Ming Lei <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html