Skip to main content

CVE-2024-26757: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-26757cvecve-2024-26757
Published: Wed Apr 03 2024 (04/03/2024, 17:00:41 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: md: Don't ignore read-only array in md_check_recovery() Usually if the array is not read-write, md_check_recovery() won't register new sync_thread in the first place. And if the array is read-write and sync_thread is registered, md_set_readonly() will unregister sync_thread before setting the array read-only. md/raid follow this behavior hence there is no problem. After commit f52f5c71f3d4 ("md: fix stopping sync thread"), following hang can be triggered by test shell/integrity-caching.sh: 1) array is read-only. dm-raid update super block: rs_update_sbs ro = mddev->ro mddev->ro = 0 -> set array read-write md_update_sb 2) register new sync thread concurrently. 3) dm-raid set array back to read-only: rs_update_sbs mddev->ro = ro 4) stop the array: raid_dtr md_stop stop_sync_thread set_bit(MD_RECOVERY_INTR, &mddev->recovery); md_wakeup_thread_directly(mddev->sync_thread); wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) 5) sync thread done: md_do_sync set_bit(MD_RECOVERY_DONE, &mddev->recovery); md_wakeup_thread(mddev->thread); 6) daemon thread can't unregister sync thread: md_check_recovery if (!md_is_rdwr(mddev) && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) return; -> -> MD_RECOVERY_RUNNING can't be cleared, hence step 4 hang; The root cause is that dm-raid manipulate 'mddev->ro' by itself, however, dm-raid really should stop sync thread before setting the array read-only. Unfortunately, I need to read more code before I can refacter the handler of 'mddev->ro' in dm-raid, hence let's fix the problem the easy way for now to prevent dm-raid regression.

AI-Powered Analysis

AILast updated: 06/29/2025, 18:12:09 UTC

Technical Analysis

CVE-2024-26757 is a medium-severity vulnerability in the Linux kernel's md (multiple device) subsystem, specifically affecting the handling of read-only arrays in the md_check_recovery() function. The md subsystem manages software RAID arrays, and this vulnerability arises due to improper synchronization and state management when toggling the read-only status of RAID arrays, particularly in dm-raid configurations. The root cause is that dm-raid manipulates the 'mddev->ro' (read-only) flag directly without properly stopping the sync thread before setting the array to read-only. This leads to a race condition where the sync thread cannot be unregistered correctly, causing the system to hang during recovery operations. The issue was triggered by a test script (shell/integrity-caching.sh) and involves a sequence of steps where the array is switched from read-only to read-write and back, with concurrent registration of sync threads. The hang occurs because the MD_RECOVERY_RUNNING bit cannot be cleared, blocking the wait_event and causing a deadlock. This vulnerability is classified under CWE-404 (Improper Resource Shutdown or Release). The CVSS 3.1 score is 5.5 (medium), with an attack vector of local (AV:L), low attack complexity (AC:L), requiring low privileges (PR:L), no user interaction (UI:N), unchanged scope (S:U), no impact on confidentiality or integrity (C:N/I:N), but high impact on availability (A:H). No known exploits are reported in the wild yet, and no patches are linked in the provided data, but the issue has been acknowledged and fixed in the Linux kernel source. This vulnerability primarily affects Linux systems using software RAID managed by md and dm-raid, especially where read-only state transitions occur during recovery or synchronization.

Potential Impact

For European organizations, the impact of CVE-2024-26757 is primarily on system availability. Organizations relying on Linux-based servers with software RAID configurations (md or dm-raid) could experience system hangs or deadlocks during RAID recovery or synchronization operations. This can lead to service disruptions, potential downtime, and degraded performance of critical infrastructure such as data centers, cloud services, and enterprise storage systems. Industries with high dependency on data integrity and availability, such as finance, healthcare, telecommunications, and government services, may face operational risks. Since the vulnerability requires local access with low privileges, it could be exploited by insiders or attackers who have gained limited access to the system. Although confidentiality and integrity are not directly impacted, the availability disruption could indirectly affect business continuity and compliance with data protection regulations like GDPR if services are interrupted. The lack of known exploits reduces immediate risk, but the presence of a reproducible hang condition means that attackers could leverage this vulnerability for denial-of-service attacks on critical Linux systems.

Mitigation Recommendations

1. Apply the latest Linux kernel updates as soon as they become available from trusted sources or your Linux distribution vendor to ensure the fix for CVE-2024-26757 is included. 2. Review and audit the use of software RAID configurations, especially those using dm-raid, to identify systems where read-only state transitions occur frequently or where sync threads are managed concurrently. 3. Implement monitoring and alerting for RAID subsystem hangs or unusual delays in md or dm-raid recovery operations to detect potential exploitation attempts early. 4. Limit local access to systems running vulnerable Linux kernels by enforcing strict access controls, multi-factor authentication, and least privilege principles to reduce the risk of local exploitation. 5. For critical systems, consider implementing redundancy at higher levels (e.g., clustering, failover mechanisms) to mitigate availability impact in case of RAID subsystem hangs. 6. Engage with Linux distribution security advisories and subscribe to relevant mailing lists to stay informed about patches and mitigation guidance. 7. If possible, avoid manual manipulation of 'mddev->ro' flags or ensure that any custom scripts or management tools properly stop sync threads before changing array read-only status to prevent triggering the race condition.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-19T14:20:24.170Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d982ac4522896dcbe3a8b

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

Last enriched: 6/29/2025, 6:12:09 PM

Last updated: 8/16/2025, 4:45:37 AM

Views: 8

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