linux/drivers/usb
Lars-Peter Clausen 0763ce1170 usb: gadget: f_fs: Fix use-after-free
[ Upstream commit 38740a5b87 ]

When using asynchronous read or write operations on the USB endpoints the
issuer of the IO request is notified by calling the ki_complete() callback
of the submitted kiocb when the URB has been completed.

Calling this ki_complete() callback will free kiocb. Make sure that the
structure is no longer accessed beyond that point, otherwise undefined
behaviour might occur.

Fixes: 2e4c7553cd ("usb: gadget: f_fs: add aio support")
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-05-10 12:17:31 -04:00
..
atm ueagle-atm: Delete unnecessary checks before the function call "release_firmware" 2015-03-18 16:56:40 +01:00
c67x00 c67x00-hcd: use USB_DT_HUB 2015-04-03 19:03:16 +02:00
chipidea usb: chipidea: otg: change workqueue ci_otg as freezable 2016-03-07 16:35:41 -05:00
class USB: cdc-acm: more sanity checking 2016-04-18 08:51:03 -04:00
common usb: common: otg-fsm: only signal connect after switching to peripheral 2015-03-19 11:28:15 -05:00
core usb: hcd: out of bounds access in for_each_companion 2016-04-20 01:13:12 -04:00
dwc2 usb: dwc2: host: sleep USB_RESUME_TIMEOUT during resume 2015-04-10 13:52:49 +02:00
dwc3 usb: dwc3: Fix assignment of EP transfer resources 2016-03-07 12:27:19 -05:00
early USB: ehci-dbgp: drop dead code. 2013-09-26 16:25:21 -07:00
gadget usb: gadget: f_fs: Fix use-after-free 2016-05-10 12:17:31 -04:00
host xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers 2016-04-20 01:13:12 -04:00
image USB: image: use msecs_to_jiffies for time conversion 2015-03-18 16:20:34 +01:00
isp1760 usb: generic resume timeout for v4.1 2015-04-10 13:45:27 +02:00
misc USB: iowarrior: fix oops with malicious USB descriptors 2016-04-18 08:51:03 -04:00
mon USB: regroup all depends on USB within an if USB block 2013-04-09 16:49:07 -07:00
musb usb: musb: USB_TI_CPPI41_DMA requires dmaengine support 2016-01-22 20:54:10 -08:00
phy usb: phy: phy-generic: Fix reset behaviour on legacy boot 2015-10-22 14:43:23 -07:00
renesas_usbhs usb: renesas_usbhs: fix to avoid using a disabled ep in usbhsg_queue_done() 2016-04-20 01:03:44 -04:00
serial USB: option: add "D-Link DWM-221 B1" device id 2016-04-20 01:08:53 -04:00
storage USB: uas: Add a new NO_REPORT_LUNS quirk 2016-04-20 01:13:12 -04:00
usbip usbip: vhci_hcd: use USB_DT_HUB 2015-04-03 19:03:15 +02:00
wusbcore wusbcore: rh: use USB_DT_HUB 2015-04-03 19:03:15 +02:00
Kconfig usb: isp1760: Move driver from drivers/usb/host/ to drivers/usb/isp1760/ 2015-01-27 09:39:38 -06:00
Makefile usb: load usb phy earlier 2015-03-18 17:25:16 +01:00
README usb: hub: rename khubd to hub_wq in documentation and comments 2014-09-23 22:33:19 -07:00
usb-skeleton.c usb: delete non-required instances of include <linux/init.h> 2014-01-08 15:01:39 -08:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.