CVE-2025-40130: scsi: ufs: core: Fix data race in CPU latency PM QoS request handling
In the Linux kernel, the following vulnerability has been resolved:
scsi: ufs: core: Fix data race in CPU latency PM QoS request handling
The cpulatencyqosadd/remove/updaterequest interfaces lack internal synchronization by design, requiring the caller to ensure thread safety. The current implementation relies on the 'pmqosenabled' flag, which is insufficient to prevent concurrent access and cannot serve as a proper synchronization mechanism. This has led to data races and list corruption issues.
A typical race condition call trace is:
[Thread A] ufshcdpmqosexit() --> cpulatencyqosremoverequest() --> cpulatencyqosapply(); --> pmqosupdatetarget() --> plistdel <--(1) delete plist node --> memset(req, 0, sizeof(req)); --> hba->pmqosenabled = false;
[Thread B] ufshcddevfreqtarget --> ufshcddevfreqscale --> ufshcdscaleclks --> ufshcdpmqosupdate <--(2) pmqosenabled is true --> cpulatencyqosupdaterequest --> pmqosupdatetarget --> plistdel <--(3) plist node use-after-free
Introduces a dedicated mutex to serialize PM QoS operations, preventing data races and ensuring safe access to PM QoS resources, including sysfs interface reads.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-40130?
CVE-2025-40130 has a medium severity rating due to potential data races in CPU latency PM QoS request handling.
How do I fix CVE-2025-40130?
To fix CVE-2025-40130, update to the latest Linux kernel version that includes the patches addressing this vulnerability.
What systems are affected by CVE-2025-40130?
CVE-2025-40130 affects the Linux kernel where the cpu_latency_qos_add/remove/update_request interfaces are utilized.
What does CVE-2025-40130 entail?
CVE-2025-40130 involves a lack of internal synchronization in CPU latency PM QoS request handling, which can lead to data races.
Is there a workaround for CVE-2025-40130?
There is no specific workaround for CVE-2025-40130 besides ensuring proper thread safety in implementations relying on the affected interfaces.