CVE-2026-99934: scsi: sd: Mark the disk dead if runtime resume fails in sd_remove()
In the Linux kernel, the following vulnerability has been resolved:
scsi: sd: Mark the disk dead if runtime resume fails in sdremove()
If a SCSI disk is unplugged while runtime suspended, its request queue is still in the pm-only state when sdremove() is called. The runtime resume attempted by scsiautopmgetdevice() fails because the parent device, e.g. a USB device in the USBSTATENOTATTACHED state, cannot be resumed. Hence, sdevruntimeresume() is not called and the pm-only state is not cleared. Next, delgendisk() calls blkreportdiskdead(disk, false), which calls syncfilesystem(). Any bio submitted by the filesystem waits forever in bioqueueenter() because the queue will never leave the pm-only state and because GDDEAD has not yet been set:
bioqueueenter+0xb8/0x174 blkmqsubmitbio+0x640/0x7e4 [ ... ] exfatsyncfs+0xa4/0xe0 syncfilesystem+0xa8/0xdc fsbdevmarkdead+0x30/0x88 bdevmarkdead+0x54/0xc4 blkreportdiskdead+0x8c/0xd4 delgendisk+0xa0/0x2f8 sdremove+0x30/0x60 [ ... ] scsiremovehost+0x88/0x18c usbstordisconnect+0x68/0xf4
Fix this hang by calling blkmarkdiskdead() if runtime resume fails. This sets GDDEAD, tells the filesystem that the disk has been removed without attempting to sync it, and wakes up any bios that are waiting in bioqueueenter(). Syncing the filesystem is not possible anyway if runtime resume failed, so no data is lost that could otherwise have been written. If runtime resume succeeds, behavior is not changed.
Please note that this patch converts temporary runtime resume failures into permanent failures. Before this patch, if runtime resume fails temporarily, a filesytem sync would be postponed until a later resume succeeds.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.20 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Compensating control
In sd_remove(), call blk_mark_disk_dead() if runtime resume fails.
Event History
Frequently Asked Questions
Which systems are exposed to this hang?
Systems using SCSI disks that can be runtime suspended are affected when such a disk is unplugged while its request queue remains in the pm-only state. The description gives a USB storage device whose parent USB device is no longer attached as an example.
What condition triggers the failure?
The disk must be removed while runtime suspended, and the runtime-resume attempt during sd_remove() must fail because its parent device cannot be resumed. In that state, the queue does not leave pm-only mode before disk removal proceeds.
What is the operational impact?
Filesystem I/O can wait indefinitely in __bio_queue_enter() during disk removal, causing the removal path to hang. The resolved change marks the disk dead when runtime resume fails, allowing the filesystem to be notified and preventing bios from waiting for a queue that will not resume.
How can I recognize an affected hang?
A kernel stack trace may show __bio_queue_enter(), blk_mq_submit_bio(), sync_filesystem(), blk_report_disk_dead(), del_gendisk(), and sd_remove(), potentially reached through USB storage disconnect handling. The event occurs after removal of a runtime-suspended SCSI disk.