Mass Storage Gadget driver truncates device >2TB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Medium
|
Juerg Haefliger |
Bug Description
[Impact]
I tried to use f_mass_storage to expose a 16TB hard drive attached to Raspberry Pi to another computer.
On the remote computer the recognised drive has incorrect capacity and the data is truncated.
After some debugging I noted the problem is caused by a bug in the read capacity function of f_mass_storage in kernel version prior to 5.15, which had already been fixed upstream in mainline kernel since v5.16
https://<email address hidden>/
I tried the kernel from https:/
I wonder if the fix can be backported to the Ubuntu kernel.
Thank you very much!
Current kernel package version: linux-raspi (5.15.0-1011.13) jammy
Hardware: Raspberry Pi 4B
[Fix]
Backport commit bedbac5f66bf ("usb: gadget: storage: add support for media larger than 2T")
[Test case]
See above.
[Where problems could occur]
Modifications are limited to the USB gadget mass storage driver, so problems should only be seen on a client that uses this driver to expose a USB drive to an attached USB host.
CVE References
description: | updated |
description: | updated |
tags: | added: kern-3929 |
Changed in linux (Ubuntu Jammy): | |
status: | Incomplete → Confirmed |
description: | updated |
description: | updated |
description: | updated |
Changed in linux (Ubuntu Jammy): | |
status: | Confirmed → Fix Committed |
tags: | added: verification-done-jammy |
Thanks for identifying the fix! This should go into the main Ubuntu kernel, not just the raspi derivative.