OpenCloudOS-Kernel/drivers/usb/gadget/function
Linyu Yuan 0698f0209d usb: gadget: f_fs: change ep->ep safe in ffs_epfile_io()
In ffs_epfile_io(), when read/write data in blocking mode, it will wait
the completion in interruptible mode, if task receive a signal, it will
terminate the wait, at same time, if function unbind occurs,
ffs_func_unbind() will kfree all eps, ffs_epfile_io() still try to
dequeue request by dereferencing ep which may become invalid.

Fix it by add ep spinlock and will not dereference ep if it is not valid.

Cc: <stable@vger.kernel.org> # 5.15
Reported-by: Michael Wu <michael@allwinnertech.com>
Tested-by: Michael Wu <michael@allwinnertech.com>
Reviewed-by: John Keeping <john@metanate.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1654863478-26228-3-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-10 14:45:38 +02:00
..
Makefile
f_acm.c usb: gadget: f_acm: add support for USB_CDC_REQ_SEND_BREAK 2022-04-21 19:20:25 +02:00
f_ecm.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-09 10:37:13 +02:00
f_eem.c usb: gadget: eem: fix echo command packet response issue 2021-06-21 11:27:22 +02:00
f_fs.c usb: gadget: f_fs: change ep->ep safe in ffs_epfile_io() 2022-06-10 14:45:38 +02:00
f_hid.c usb: gadget: f_hid: optional SETUP/SET_REPORT mode 2021-08-24 15:41:08 +02:00
f_loopback.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-09 10:37:13 +02:00
f_mass_storage.c USB/Thunderbolt patches for 5.18-rc1 2022-03-26 13:08:25 -07:00
f_mass_storage.h
f_midi.c usb: gadget: f_midi: allow resetting index option 2021-11-17 14:40:43 +01:00
f_ncm.c usb: gadget: f_ncm: ncm_wrap_ntb - move var definitions into if statement 2021-07-21 10:04:19 +02:00
f_obex.c
f_phonet.c usb: gadget: f_phonet: Use struct_size() helper in kzalloc() 2022-01-26 14:01:28 +01:00
f_printer.c Linux 5.13-rc6 2021-06-14 09:18:07 +02:00
f_rndis.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-09 10:37:13 +02:00
f_serial.c usb: gadget: f_serial: Ensure gserial disconnected during unbind 2022-01-26 13:57:59 +01:00
f_sourcesink.c usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS 2022-01-26 13:41:53 +01:00
f_subset.c usb: fix various gadgets null ptr deref on 10gbps cabling. 2021-06-09 10:37:13 +02:00
f_tcm.c scsi: target: usb: Replace enable attr with ops.enable 2021-10-04 23:27:39 -04:00
f_uac1.c usb: gadget: f_uac1: allow changing interface name via configfs 2022-01-26 14:10:40 +01:00
f_uac1_legacy.c
f_uac2.c Linux 5.17-rc4 2022-02-14 09:04:36 +01:00
f_uvc.c USB / Thunderbolt changes for 5.19-rc1 2022-06-03 11:17:49 -07:00
f_uvc.h
g_zero.h
ndis.h
rndis.c usb: gadget: rndis: prevent integer overflow in rndis_set_response() 2022-03-15 15:48:57 +01:00
rndis.h usb: gadget: rndis: add spinlock for rndis response list 2022-02-24 11:16:57 +01:00
storage_common.c
storage_common.h
tcm.h
u_audio.c usb: gadget: u_audio: clean up some inconsistent indenting 2022-04-21 19:03:07 +02:00
u_audio.h usb: gadget: u_audio: Add suspend call 2022-01-26 14:06:09 +01:00
u_ecm.h
u_eem.h
u_ether.c usb: gadget: u_ether: fix regression in setting fixed MAC address 2022-06-10 11:12:53 +02:00
u_ether.h usb: gadget: u_ether: support configuring interface names. 2021-01-15 16:08:53 +01:00
u_ether_configfs.h USB: gadget: u_ether: Fix a configfs return code 2021-03-10 09:36:12 +01:00
u_fs.h
u_gether.h
u_hid.h usb: gadget: f_hid: optional SETUP/SET_REPORT mode 2021-08-24 15:41:08 +02:00
u_midi.h usb: gadget: function: Fix inconsistent indent 2021-05-10 11:16:10 +02:00
u_ncm.h
u_phonet.h
u_printer.h
u_rndis.h
u_serial.c Merge 5.14-rc5 into tty-next 2021-08-09 08:52:46 +02:00
u_serial.h
u_tcm.h
u_uac1.h usb: gadget: f_uac1: allow changing interface name via configfs 2022-01-26 14:10:40 +01:00
u_uac1_legacy.c
u_uac1_legacy.h
u_uac2.h usb: gadget: f_uac2: Optionally determine bInterval for HS and SS 2022-01-31 14:26:18 +01:00
u_uvc.h usb: gadget: uvc: allow changing interface name via configfs 2022-04-21 18:14:34 +02:00
uac_common.h usb: gadget: u_audio: Support multiple sampling rates 2022-01-26 14:06:08 +01:00
uvc.h USB / Thunderbolt changes for 5.19-rc1 2022-06-03 11:17:49 -07:00
uvc_configfs.c usb: gadget: uvc: track frames in format entries 2022-05-05 22:10:36 +02:00
uvc_configfs.h usb: gadget: uvc: track frames in format entries 2022-05-05 22:10:36 +02:00
uvc_queue.c Linux 5.18-rc5 2022-05-03 16:35:26 +02:00
uvc_queue.h usb: gadget: uvc: rework uvcg_queue_next_buffer to uvcg_complete_buffer 2022-04-21 18:15:33 +02:00
uvc_v4l2.c usb: gadget: uvc: allow for application to cleanly shutdown 2022-05-05 22:17:43 +02:00
uvc_v4l2.h
uvc_video.c usb: gadget: uvc: improve sg exit condition 2022-04-21 18:15:33 +02:00
uvc_video.h usb: gadget: uvc: consistently use define for headerlen 2021-10-21 12:53:31 +02:00