Skip to main content

CVE-2024-39476: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-39476cvecve-2024-39476
Published: Fri Jul 05 2024 (07/05/2024, 06:55:06 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING Xiao reported that lvm2 test lvconvert-raid-takeover.sh can hang with small possibility, the root cause is exactly the same as commit bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"") However, Dan reported another hang after that, and junxiao investigated the problem and found out that this is caused by plugged bio can't issue from raid5d(). Current implementation in raid5d() has a weird dependence: 1) md_check_recovery() from raid5d() must hold 'reconfig_mutex' to clear MD_SB_CHANGE_PENDING; 2) raid5d() handles IO in a deadloop, until all IO are issued; 3) IO from raid5d() must wait for MD_SB_CHANGE_PENDING to be cleared; This behaviour is introduce before v2.6, and for consequence, if other context hold 'reconfig_mutex', and md_check_recovery() can't update super_block, then raid5d() will waste one cpu 100% by the deadloop, until 'reconfig_mutex' is released. Refer to the implementation from raid1 and raid10, fix this problem by skipping issue IO if MD_SB_CHANGE_PENDING is still set after md_check_recovery(), daemon thread will be woken up when 'reconfig_mutex' is released. Meanwhile, the hang problem will be fixed as well.

AI-Powered Analysis

AILast updated: 06/28/2025, 04:09:37 UTC

Technical Analysis

CVE-2024-39476 is a vulnerability in the Linux kernel's RAID5 implementation that can cause a deadlock and CPU resource exhaustion. The issue arises from the raid5d() kernel thread, which handles RAID5 I/O operations. The vulnerability is due to a circular dependency involving the clearing of the MD_SB_CHANGE_PENDING flag and the holding of the 'reconfig_mutex' mutex. Specifically, raid5d() waits for the MD_SB_CHANGE_PENDING flag to clear before issuing I/O, but clearing this flag requires md_check_recovery() to hold 'reconfig_mutex'. If another context holds 'reconfig_mutex', md_check_recovery() cannot clear the flag, causing raid5d() to enter a busy-wait loop, consuming 100% CPU on one core and effectively hanging the RAID5 device. This deadlock condition was introduced before Linux kernel version 2.6 and affects multiple kernel versions as indicated by the affected commit hashes. The fix involves changing raid5d() to skip issuing I/O if MD_SB_CHANGE_PENDING remains set after md_check_recovery(), and waking the daemon thread once 'reconfig_mutex' is released, thereby preventing the deadlock and hang. This vulnerability was discovered through testing of LVM2's lvconvert-raid-takeover.sh script, which could hang with a small probability due to this issue. No known exploits are reported in the wild as of publication. The vulnerability impacts systems using Linux software RAID5 configurations, which are common in enterprise and server environments for data redundancy and performance. The root cause is a synchronization and locking design flaw in the RAID5 kernel code, leading to a denial of service condition via resource exhaustion and hang.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to servers and storage systems running Linux with software RAID5 configurations. The deadlock can cause RAID5 devices to hang and consume excessive CPU resources, leading to degraded system performance, potential downtime, and disruption of critical services relying on RAID5 storage. This can impact data availability and operational continuity, especially in data centers, cloud providers, and enterprises using Linux-based storage solutions. Organizations with high reliance on Linux RAID5 for storage redundancy and performance may experience service interruptions or require emergency maintenance to apply patches. While this vulnerability does not directly lead to data corruption or unauthorized access, the denial of service effect can indirectly affect business operations and service level agreements. Given the widespread use of Linux in European IT infrastructure, including government, finance, telecommunications, and industry sectors, the impact can be significant if unpatched. However, the absence of known exploits and the requirement for specific RAID5 configurations somewhat limit immediate exploitation risk.

Mitigation Recommendations

European organizations should prioritize applying the official Linux kernel patches that address CVE-2024-39476 as soon as they become available from their Linux distribution vendors. Specifically, updating to kernel versions that include the fix for the raid5d() deadlock is critical. Organizations should audit their infrastructure to identify systems using Linux software RAID5 and assess their exposure. For systems where immediate patching is not feasible, consider temporarily disabling RAID5 arrays or migrating data to alternative RAID levels (e.g., RAID10) or storage solutions that do not rely on the vulnerable code path. Monitoring CPU usage on RAID5 hosts can help detect symptoms of the deadlock. Additionally, review and minimize concurrent operations that hold the 'reconfig_mutex' for extended periods to reduce deadlock risk. Implementing robust change management and testing procedures before deploying kernel updates will help ensure stability. Finally, maintain regular backups and disaster recovery plans to mitigate potential downtime impacts.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-25T14:23:23.746Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9821c4522896dcbdde66

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

Last enriched: 6/28/2025, 4:09:37 AM

Last updated: 8/16/2025, 12:38:09 PM

Views: 13

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