Executive brief
A flaw was found in the Linux kernel's clock management system, which handles how hardware components are powered on and off. Under specific conditions, the system can enter a 'deadlock' state where two internal processes wait for each other indefinitely, causing the system to hang or become unresponsive. This primarily affects system stability and availability, potentially requiring a hard reboot to recover.
Technical details
A classic ABBA deadlock exists in the Linux kernel clk subsystem. The vulnerability occurs when one thread walking the clk tree holds the 'prepare_lock' and attempts to resume a device via 'clk_pm_runtime_get()', while a second thread performing a runtime PM resume of the same device attempts to acquire the 'prepare_lock' via 'clk_prepare()'. This circular dependency leads to a hung task. The fix involves ensuring runtime PM references are acquired before walking the clk tree and holding the 'prepare_lock' during the 'disable_unused' phase. The issue is more easily triggered on specific hardware platforms like Qualcomm sc7180.
Affected products
- Linux Linux Kernel All versions prior to fixed releases in 5.15.y, 6.1.y, 6.6.y, etc.
Timeline
- 2024-03-25: patched: Initial patch submitted by Stephen Boyd
- 2024-05-01: advisory: CVE-2024-27004 published in NVD
References
- https://git.kernel.org/stable/c/115554862294397590088ba02f11f2aba6d5016c
- https://git.kernel.org/stable/c/253ab38d1ee652a596942156978a233970d185ba
- https://git.kernel.org/stable/c/4af115f1a20a3d9093586079206ee37c2ac55123
- https://git.kernel.org/stable/c/60ff482c4205a5aac3b0595ab794cfd62295dab5
- https://git.kernel.org/stable/c/a29ec0465dce0b871003698698ac6fa92c9a5034
- https://git.kernel.org/stable/c/a424e713e0cc33d4b969cfda25b9f46df4d7b5bc
- https://git.kernel.org/stable/c/e581cf5d216289ef292d1a4036d53ce90e122469