CVE-2026-99936: scsi: ufs: core: Fix a deadlock between clock scaling and device commands
In the Linux kernel, the following vulnerability has been resolved:
scsi: ufs: core: Fix a deadlock between clock scaling and device commands
Since commit 08b12cda6c44 ("scsi: ufs: core: Switch to scsigetinternalcmd()"), device management commands go through blkexecuterq() on the pseudo SCSI device, which shares the tagset with the logical units, while ufshcddevmanlock() holds clkscalinglock for reading.
ufshcdclockscalingprepare() and ufshcdpausecommandprocessing() quiesce the tagset before taking clkscalinglock for writing. A device management command holding the lock for reading at that point is never dispatched and never times out, so the writer waits forever with all logical units quiesced. On a Lenovo Legion Tab Y700 Gen 5 this ended in a hung task panic.
Take clkscalinglock before quiescing the tagset, and in ufshcdclockscalingprepare() also wbmutex, which is always taken before clkscalinglock. Release them in the reverse order. Commit b52d695d0620 ("scsi: ufs: core: Keep internal commands dispatchable during error handling") fixed the same problem in the error handler.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch b52d695d0620
Event History
Frequently Asked Questions
What systems are exposed to this deadlock?
Linux systems using the UFS core are affected when device-management commands share the pseudo SCSI device tagset with logical units and clock scaling or command-processing pause paths are exercised. The reported failure occurred on a Lenovo Legion Tab Y700 Gen 5, but the description does not limit the issue to that device.
Does exploitation require an unprivileged attacker or a crafted external request?
The provided information describes a kernel synchronization flaw triggered by interaction between internal device-management commands and clock-scaling or command-processing paths. It does not identify an external attacker input, required privileges, or a remote attack vector.
What is the operational impact if the issue occurs?
A device-management command can retain the clock-scaling read lock after the tagset is quiesced, preventing it from being dispatched or timing out. The writer then waits indefinitely while all logical units remain quiesced, potentially resulting in hung tasks and a kernel panic.
Is there a workaround if the corrected kernel cannot be deployed immediately?
No workaround or configuration-based mitigation is provided. The described resolution changes lock ordering so the clock-scaling lock, and in one path wb_mutex, are acquired before quiescing the tagset.