linux-brain/drivers/usb/gadget/function
Jerome Brunet 0ad96094ab usb: gadget: u_audio: fix race condition on endpoint stop
[ Upstream commit 068fdad20454f815e61e6f6eb9f051a8b3120e88 ]

If the endpoint completion callback is call right after the ep_enabled flag
is cleared and before usb_ep_dequeue() is call, we could do a double free
on the request and the associated buffer.

Fix this by clearing ep_enabled after all the endpoint requests have been
dequeued.

Fixes: 7de8681be2cd ("usb: gadget: u_audio: Free requests only after callback")
Cc: stable <stable@vger.kernel.org>
Reported-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210827092927.366482-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-03 10:08:14 +02:00
..
Makefile
f_acm.c USB: gadget: f_acm: add support for SuperSpeed Plus 2020-12-30 11:50:58 +01:00
f_ecm.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_eem.c usb: gadget: eem: fix echo command packet response issue 2021-07-14 16:53:00 +02:00
f_fs.c usb: gadget: f_fs: Fix setting of device and driver data cross-references 2021-07-14 16:53:42 +02:00
f_hid.c usb: gadget: f_hid: idle uses the highest byte for duration 2021-08-12 13:21:00 +02:00
f_loopback.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_mass_storage.c
f_mass_storage.h
f_midi.c USB: gadget: f_midi: setup SuperSpeed Plus descriptors 2020-12-30 11:50:58 +01:00
f_ncm.c usb: f_ncm: only first packet of aggregate needs to start timer 2021-06-16 11:59:41 +02:00
f_obex.c
f_phonet.c
f_printer.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_rndis.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_serial.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_sourcesink.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_subset.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_tcm.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-16 11:59:43 +02:00
f_uac1.c usb: gadget: f_uac1: validate input parameters 2021-05-11 14:04:05 +02:00
f_uac1_legacy.c
f_uac2.c usb: gadget: f_uac2: validate input parameters 2021-05-11 14:04:05 +02:00
f_uvc.c usb: webcam: Invalid size of Processing Unit Descriptor 2021-05-11 14:04:05 +02:00
f_uvc.h
g_zero.h
ndis.h
rndis.c
rndis.h
storage_common.c
storage_common.h
tcm.h
u_audio.c usb: gadget: u_audio: fix race condition on endpoint stop 2021-09-03 10:08:14 +02:00
u_audio.h
u_ecm.h
u_eem.h
u_ether.c usb: gadget: u_ether: Fix MTU size mismatch with RX packet size 2021-01-12 20:16:21 +01:00
u_ether.h
u_ether_configfs.h USB: gadget: u_ether: Fix a configfs return code 2021-03-17 17:03:48 +01:00
u_fs.h
u_gether.h
u_hid.h
u_midi.h
u_ncm.h
u_phonet.h
u_printer.h
u_rndis.h
u_serial.c
u_serial.h
u_tcm.h
u_uac1.h
u_uac1_legacy.c
u_uac1_legacy.h
u_uac2.h
u_uvc.h
uvc.h
uvc_configfs.c
uvc_configfs.h
uvc_queue.c
uvc_queue.h
uvc_v4l2.c
uvc_v4l2.h
uvc_video.c
uvc_video.h