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
f_eem.c
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
f_loopback.c
f_mass_storage.c usb: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
f_mass_storage.h
f_midi.c
f_ncm.c
f_obex.c
f_phonet.c
f_printer.c
f_rndis.c
f_serial.c
f_sourcesink.c
f_subset.c
f_tcm.c
f_uac1_legacy.c
f_uac1.c
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
g_zero.h
Makefile
ndis.h
rndis.c
rndis.h
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
u_audio.c
u_audio.h
u_ecm.h
u_eem.h
u_ether_configfs.h
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
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_legacy.c
u_uac1_legacy.h
u_uac1.h
u_uac2.h
u_uvc.h
uac_common.h
uvc_configfs.c usb: gadget: uvc: fix changing interface name via configfs 2022-07-08 14:58:25 +02:00
uvc_configfs.h
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
uvc_v4l2.c
uvc_v4l2.h
uvc_video.c Linux 5.19-rc4 2022-06-27 10:03:28 +02:00
uvc_video.h
uvc.h