Floppy fixes for 7.4
Hi Jens,
Floppy fixes for the 7.4 merge window, based on your for-7.4/block branch.
Please pull
The following changes since commit 9690943353cec1690a715e000ba6a74e5139f530:
block: amiflop: synchronize flush timer before track flush (2026-10-01 08:37:58 -0600)
are available in the Git repository at:
https://github.com/evdenis/linux-floppy.git tags/floppy-for-7.4
for you to fetch changes up to bb38473f1bcb287567f2fa7980e483a778092504:
floppy: return the drive state flags from the 32-bit FDGETDRVSTAT (2026-10-05 18:59:41 +0400)
----------------------------------------------------------------
Floppy fixes for 7.4
Six fixes for long-standing floppy bugs, most of them found by syzbot or by race detectors:
- Flush pending work before releasing the IRQ and DMA when no FDC is found, from Karl Mehltretter. The work queued by the probe could run after the IRQ and DMA were already freed ("work still pending").
- Unregister the platform device when add_disk() fails, from Guangshuo Li. The failing drive's device stayed registered after the module was unloaded, and reading its sysfs attributes oopsed on freed module memory.
- Return early from reset_interrupt() when cont is already NULL, from Yang Xiuwei. This fixes the syzbot GPF in reset_interrupt(). I decided to take v1 as a partial solution; the full fix will require additional rework.
- Replace volatile on command_status with READ_ONCE()/WRITE_ONCE() and annotate floppy_work_fn and current_type[], from Cen Zhang. No functional change.
- Don't keep a pointer to a stack buffer in timeout_message. show_floppy() printed it from the interrupt handler after request_done() had returned (syzbot KASAN report).
- Copy the drive state flags in the 32-bit FDGETDRVSTAT and FDPOLLDRVSTAT. Since 4.13 the compat path returned flags == 0, so 32-bit fdutils saw every disk as write-protected and never saw a disk change.
Tested in QEMU with a floppy test suite (including the compat ioctls from 32-bit userspace, and fdutils/mtools/dosfstools workflows) on KASAN and KCSAN kernels, with no new warnings.
----------------------------------------------------------------
Cen Zhang (1):
floppy: annotate data-races around command_status and floppy_work_fn
Denis Efremov (Oracle) (2):
floppy: don't store a stack buffer in timeout_message
floppy: return the drive state flags from the 32-bit FDGETDRVSTAT
Guangshuo Li (1):
floppy: unregister platform device on add_disk failure
Karl Mehltretter (1):
floppy: flush pending work before releasing resources on init failure
Yang Xiuwei (1):
floppy: avoid NULL deref in reset_interrupt when cont is cleared
drivers/block/floppy.c | 56 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 22 deletions(-)
Jens Axboe
maintainerQuoted 6 lines · Denis Efremov (Oracle)
Hi Jens,
Floppy fixes for the 7.4 merge window, based on your for-7.4/block branch.
Please pull
Pulled, thanks.
Signature · 1 line
Jens Axboe