OpenCloudOS-Kernel/include/linux/usb
Ming Lei 5b6e9bcdeb usbnet: fix skb traversing races during unlink(v2)
Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
recursive locking in usbnet_stop()) fixes the recursive locking
problem by releasing the skb queue lock before unlink, but may
cause skb traversing races:
	- after URB is unlinked and the queue lock is released,
	the refered skb and skb->next may be moved to done queue,
	even be released
	- in skb_queue_walk_safe, the next skb is still obtained
	by next pointer of the last skb
	- so maybe trigger oops or other problems

This patch extends the usage of entry->state to describe 'start_unlink'
state, so always holding the queue(rx/tx) lock to change the state if
the referd skb is in rx or tx queue because we need to know if the
refered urb has been started unlinking in unlink_urbs.

The other part of this patch is based on Huajun's patch:
always traverse from head of the tx/rx queue to get skb which is
to be unlinked but not been started unlinking.

Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-15 13:41:42 -04:00
..
Kbuild USB: export video.h to the includes available for userspace 2011-09-23 23:07:26 -03:00
association.h
atmel_usba_udc.h
audio-v2.h usb: uac2: Add ACHeader and FormatType descriptor 2012-02-15 10:10:11 +02:00
audio.h
c67x00.h
cdc-wdm.h usb: cdc-wdm: adding usb_cdc_wdm_register subdriver support 2012-03-08 13:06:48 -08:00
cdc.h
ch9.h xHCI: BESL calculation based on USB2.0 LPM errata 2012-03-12 09:31:24 -07:00
ch11.h USB/xHCI: Enable USB 3.0 hub remote wakeup. 2012-02-14 12:12:24 -08:00
composite.h usb: gadget: add SuperSpeed support to the Gadget Framework 2011-07-01 14:27:05 -07:00
ehci_def.h USB: EHCI: Support controllers with big endian capability regs 2011-05-03 11:43:21 -07:00
ehci_pdriver.h USB: EHCI: Add a generic platform device driver 2012-03-15 12:42:07 -07:00
functionfs.h
g_hid.h
g_printer.h
gadget.h usb: gadget: add generic map/unmap request utilities 2012-02-28 14:48:23 +02:00
gadgetfs.h
gpio_vbus.h
hcd.h USB: EHCI: fix crash during suspend on ASUS computers 2012-04-24 13:55:43 -07:00
input.h
intel_mid_otg.h usb: otg: Rename otg_transceiver to usb_phy 2012-02-13 13:34:36 +02:00
iowarrior.h
irda.h
isp116x.h
isp1362.h
isp1760.h
langwell_udc.h
m66592.h usb: gadget: m66592-udc: add function for external controller 2011-07-09 01:08:39 +03:00
midi.h
msm_hsusb.h usb: otg: msm: Start using struct usb_otg 2012-02-13 13:35:38 +02:00
msm_hsusb_hw.h USB: OTG: msm: Add PHY suspend support for MSM8960 2011-05-06 18:27:49 -07:00
musb.h
net2280.h
ohci_pdriver.h USB: OHCI: Add a generic platform device driver 2012-03-15 12:41:58 -07:00
otg.h usb: musb: wake the device before ulpi transfers 2012-04-10 19:11:48 +03:00
quirks.h
r8a66597.h usb: gadget: r8a66597-udc: add support for SUDMAC 2011-10-13 20:38:39 +03:00
renesas_usbhs.h usb: renesas_usbhs: add support for SUDMAC 2012-01-24 11:33:04 +02:00
rndis_host.h
serial.h USB: fix bug in serial driver unregistration 2012-04-09 15:36:20 -07:00
sl811.h
storage.h usb/storage: remove Filler member from struct bulk_cs_wrap 2012-02-28 11:11:22 -08:00
tmc.h
uas.h usb/uas: add usb_pipe_usage_descriptor 2012-02-02 14:51:19 -08:00
ulpi.h usb: otg: ulpi: Start using struct usb_otg 2012-02-13 13:35:56 +02:00
usbnet.h usbnet: fix skb traversing races during unlink(v2) 2012-05-15 13:41:42 -04:00
video.h
wusb-wa.h
wusb.h