Skip to main content

CVE-2024-49985: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-49985cvecve-2024-49985
Published: Mon Oct 21 2024 (10/21/2024, 18:02:29 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: i2c: stm32f7: Do not prepare/unprepare clock during runtime suspend/resume In case there is any sort of clock controller attached to this I2C bus controller, for example Versaclock or even an AIC32x4 I2C codec, then an I2C transfer triggered from the clock controller clk_ops .prepare callback may trigger a deadlock on drivers/clk/clk.c prepare_lock mutex. This is because the clock controller first grabs the prepare_lock mutex and then performs the prepare operation, including its I2C access. The I2C access resumes this I2C bus controller via .runtime_resume callback, which calls clk_prepare_enable(), which attempts to grab the prepare_lock mutex again and deadlocks. Since the clock are already prepared since probe() and unprepared in remove(), use simple clk_enable()/clk_disable() calls to enable and disable the clock on runtime suspend and resume, to avoid hitting the prepare_lock mutex.

AI-Powered Analysis

AILast updated: 06/28/2025, 15:55:37 UTC

Technical Analysis

CVE-2024-49985 is a vulnerability identified in the Linux kernel specifically affecting the I2C bus controller implementation for the stm32f7 platform. The issue arises from improper handling of clock controller operations during runtime suspend and resume sequences. In particular, when a clock controller (such as Versaclock or an AIC32x4 I2C codec) is attached to the I2C bus controller, an I2C transfer initiated from the clock controller's clk_ops.prepare callback can cause a deadlock. This deadlock occurs because the clock controller first acquires the prepare_lock mutex and then performs an I2C transfer that triggers the I2C bus controller's runtime_resume callback. The runtime_resume callback calls clk_prepare_enable(), which attempts to acquire the same prepare_lock mutex again, resulting in a deadlock due to the mutex being already held. The root cause is the recursive locking attempt on prepare_lock during clock prepare operations. The fix involves changing the clock enable/disable calls during runtime suspend and resume to use clk_enable()/clk_disable() instead of prepare/unprepare, as the clocks are already prepared during probe() and unprepared during remove(). This prevents the recursive locking and deadlock scenario. The vulnerability affects Linux kernel versions identified by the commit hash 4e7bca6fc07bf9526d797b9787dcb21e40cd10cf and similar revisions. No known exploits are reported in the wild as of the publication date (October 21, 2024).

Potential Impact

For European organizations, the primary impact of this vulnerability is potential system instability or denial of service (DoS) on devices running affected Linux kernel versions with stm32f7 I2C bus controllers and attached clock controllers. This is particularly relevant for embedded systems, industrial control systems, and IoT devices that rely on these specific hardware components and Linux kernel versions. A deadlock in the kernel can cause the affected device to hang or become unresponsive, disrupting critical operations. While this vulnerability does not directly lead to privilege escalation or data leakage, the availability impact can be significant in environments where uptime and reliability are critical, such as manufacturing plants, telecommunications infrastructure, or medical devices. The lack of known exploits reduces immediate risk, but the complexity of the issue means that unpatched systems remain vulnerable to accidental or triggered deadlocks during runtime suspend/resume cycles. Organizations using custom Linux builds or embedded Linux on stm32f7 platforms should prioritize patching to avoid operational disruptions.

Mitigation Recommendations

European organizations should take the following specific mitigation steps: 1) Identify all devices and systems running affected Linux kernel versions with stm32f7 I2C bus controllers and attached clock controllers. 2) Apply the official Linux kernel patch that replaces clk_prepare_enable()/clk_prepare_disable() calls with clk_enable()/clk_disable() during runtime suspend and resume to prevent the deadlock condition. 3) For embedded or industrial devices where kernel updates are challenging, consider vendor firmware updates or workarounds that disable runtime suspend/resume for the affected I2C controllers if feasible. 4) Implement monitoring for kernel hangs or deadlocks related to I2C bus operations to detect potential exploitation or accidental triggering of this vulnerability. 5) Coordinate with hardware vendors to ensure updated drivers and firmware are deployed. 6) Test patches in staging environments to verify that the fix does not introduce regressions in clock or power management functionality. 7) Maintain an inventory of affected hardware and software to streamline patch management and incident response.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T12:17:06.054Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9824c4522896dcbdfbf6

Added to database: 5/21/2025, 9:08:52 AM

Last enriched: 6/28/2025, 3:55:37 PM

Last updated: 8/13/2025, 1:45:06 AM

Views: 16

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats