linux/drivers/usb/usbip
Suwan Kim 5833560d54 usbip: Fix free of unallocated memory in vhci tx
[ Upstream commit d4d8257754 ]

iso_buffer should be set to NULL after use and free in the while loop.
In the case of isochronous URB in the while loop, iso_buffer is
allocated and after sending it to server, buffer is deallocated. And
then, if the next URB in the while loop is not a isochronous pipe,
iso_buffer still holds the previously deallocated buffer address and
kfree tries to free wrong buffer address.

Fixes: ea44d19076 ("usbip: Implement SG support to vhci-hcd and stub driver")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
Reviewed-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20191022093017.8027-1-suwan.kim027@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-12 19:21:20 +01:00
..
Kconfig
Makefile
README
stub_dev.c usbip: usbip_host: fix stub_dev lock context imbalance regression 2019-06-09 09:17:11 +02:00
stub_main.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
stub_rx.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
stub_tx.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
stub.h usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
usbip_common.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
usbip_common.h
usbip_event.c
vhci_hcd.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
vhci_rx.c usbip: Implement SG support to vhci-hcd and stub driver 2019-11-12 19:20:52 +01:00
vhci_sysfs.c
vhci_tx.c usbip: Fix free of unallocated memory in vhci tx 2019-11-12 19:21:20 +01:00
vhci.h
vudc_dev.c
vudc_main.c
vudc_rx.c
vudc_sysfs.c
vudc_transfer.c
vudc_tx.c
vudc.h

TODO:
	- more discussion about the protocol
	- testing
	- review of the userspace interface
	- document the protocol

Please send patches for this code to Greg Kroah-Hartman <greg@kroah.com>