1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/usb/gadget/function
Krishna Kurapati 9d4dc16ec7 usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS
During cdrom emulation, the response to read_toc command must contain
the cdrom address as the number of sectors (2048 byte sized blocks)
represented either as an absolute value (when MSF bit is '0') or in
terms of PMin/PSec/PFrame (when MSF bit is set to '1'). Incase of
cdrom, the fsg_lun_open call sets the sector size to 2048 bytes.

When MAC OS sends a read_toc request with MSF set to '1', the
store_cdrom_address assumes that the address being provided is the
LUN size represented in 512 byte sized blocks instead of 2048. It
tries to modify the address further to convert it to 2048 byte sized
blocks and store it in MSF format. This results in data transfer
failures as the cdrom address being provided in the read_toc response
is incorrect.

Fixes: 3f565a363c ("usb: gadget: storage: adapt logic block size to bound block devices")
Cc: stable@vger.kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Link: https://lore.kernel.org/r/1661570110-19127-1-git-send-email-quic_kriskura@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-30 15:33:12 +02:00
..
f_acm.c USB: gadget: f_acm: use CDC defines 2022-07-25 10:57:42 +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: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
f_mass_storage.h usb: gadget: storage: Remove reference counting 2018-07-26 13:55:39 +03:00
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 usb: gadget: u_serial: make OBEX port not a console 2019-10-22 10:27:09 +03:00
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 usb: gadget: function: fix missing spinlock in f_uac1_legacy 2020-07-09 10:13:07 +03:00
f_uac2.c usb: gadget: f_uac2: fix superspeed transfer 2022-08-19 11:11:16 +02:00
f_uvc.c usb: gadget: uvc: Fix comment blocks style 2022-06-10 11:20:30 +02:00
f_uvc.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
g_zero.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS 2022-08-30 15:33:12 +02:00
storage_common.h usb: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
tcm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_eem.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_ether.c usb: gadget: u_ether: Remove duplicated include in u_ether.c 2022-06-24 13:42:17 +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 USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_gether.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
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 USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_phonet.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_printer.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_rndis.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
u_serial.c Merge 5.14-rc5 into tty-next 2021-08-09 08:52:46 +02:00
u_serial.h usb: gadget: u_serial.h: increase MAX_U_SERIAL_PORTS to 8 2020-06-18 10:23:22 +02:00
u_tcm.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
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 usb: gadget: function: u_uac1_legacy: Demote obvious misuse of kerneldoc to standard comment blocks 2020-07-09 17:19:58 +02:00
u_uac1_legacy.h USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
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: fix changing interface name via configfs 2022-07-08 14:58:25 +02:00
uvc_configfs.h usb: gadget: uvc: track frames in format entries 2022-05-05 22:10:36 +02:00
uvc_queue.c usb: gadget: uvc: calculate the number of request depending on framesize 2022-06-10 11:50:54 +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 USB: gadget: Use the correct style for SPDX License Identifier 2020-05-05 10:58:49 +03:00
uvc_video.c Linux 5.19-rc4 2022-06-27 10:03:28 +02:00
uvc_video.h usb: gadget: uvc: consistently use define for headerlen 2021-10-21 12:53:31 +02:00