linux/drivers/usb
Krishna Kurapati 6202637fde usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS
commit 9d4dc16ec7 upstream.

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-09-08 11:11:40 +02:00
..
atm
c67x00
cdns3 usb: cdns3 fix use-after-free at workaround 2 2022-08-25 11:38:12 +02:00
chipidea usb: chipidea: udc: check request status before setting device address 2022-06-29 08:59:51 +02:00
class USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020) 2022-09-08 11:11:39 +02:00
common usb: ulpi: Call of_node_put correctly 2022-02-16 12:54:28 +01:00
core USB: core: Prevent nested device-reset calls 2022-09-08 11:11:40 +02:00
dwc2 usb: dwc2: fix wrong order of phy_power_on and phy_init 2022-09-08 11:11:39 +02:00
dwc3 usb: dwc3: qcom: fix missing optional irq warnings 2022-08-21 15:15:59 +02:00
early Revert "usb: early: convert to readl_poll_timeout_atomic()" 2021-12-22 09:30:56 +01:00
gadget usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS 2022-09-08 11:11:40 +02:00
host xhci: Add grace period after xHC start to prevent premature runtime suspend. 2022-09-08 11:11:39 +02:00
image
isp1760
misc usb: misc: fix improper handling of refcount in uss720_probe() 2022-05-09 09:04:58 +02:00
mon
mtu3 usb: mtu3: fix USB 3.0 dual-role-switch from device to host 2022-05-09 09:04:56 +02:00
musb usb: musb: Fix missing of_node_put() in omap2430_probe 2022-06-14 18:32:31 +02:00
phy usb: phy: generic: Get the vbus supply 2022-05-09 09:04:59 +02:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-08-25 11:38:13 +02:00
roles usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode() 2021-05-14 09:49:55 +02:00
serial USB: serial: option: add support for Cinterion MV32-WA/WB RmNet mode 2022-09-08 11:11:39 +02:00
storage usb-storage: Add ignore-residue quirk for NXP PN7462AU 2022-09-08 11:11:39 +02:00
typec usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles 2022-09-08 11:11:39 +02:00
usbip usb: usbip: add missing device lock on tweak configuration cmd 2022-06-14 18:32:31 +02:00
Kconfig
Makefile
usb-skeleton.c