Skip to main content

CVE-2025-21634: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21634cvecve-2025-21634
Published: Sun Jan 19 2025 (01/19/2025, 10:17:52 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: cgroup/cpuset: remove kernfs active break A warning was found: WARNING: CPU: 10 PID: 3486953 at fs/kernfs/file.c:828 CPU: 10 PID: 3486953 Comm: rmdir Kdump: loaded Tainted: G RIP: 0010:kernfs_should_drain_open_files+0x1a1/0x1b0 RSP: 0018:ffff8881107ef9e0 EFLAGS: 00010202 RAX: 0000000080000002 RBX: ffff888154738c00 RCX: dffffc0000000000 RDX: 0000000000000007 RSI: 0000000000000004 RDI: ffff888154738c04 RBP: ffff888154738c04 R08: ffffffffaf27fa15 R09: ffffed102a8e7180 R10: ffff888154738c07 R11: 0000000000000000 R12: ffff888154738c08 R13: ffff888750f8c000 R14: ffff888750f8c0e8 R15: ffff888154738ca0 FS: 00007f84cd0be740(0000) GS:ffff8887ddc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555f9fbe00c8 CR3: 0000000153eec001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: kernfs_drain+0x15e/0x2f0 __kernfs_remove+0x165/0x300 kernfs_remove_by_name_ns+0x7b/0xc0 cgroup_rm_file+0x154/0x1c0 cgroup_addrm_files+0x1c2/0x1f0 css_clear_dir+0x77/0x110 kill_css+0x4c/0x1b0 cgroup_destroy_locked+0x194/0x380 cgroup_rmdir+0x2a/0x140 It can be explained by: rmdir echo 1 > cpuset.cpus kernfs_fop_write_iter // active=0 cgroup_rm_file kernfs_remove_by_name_ns kernfs_get_active // active=1 __kernfs_remove // active=0x80000002 kernfs_drain cpuset_write_resmask wait_event //waiting (active == 0x80000001) kernfs_break_active_protection // active = 0x80000001 // continue kernfs_unbreak_active_protection // active = 0x80000002 ... kernfs_should_drain_open_files // warning occurs kernfs_put_active This warning is caused by 'kernfs_break_active_protection' when it is writing to cpuset.cpus, and the cgroup is removed concurrently. The commit 3a5a6d0c2b03 ("cpuset: don't nest cgroup_mutex inside get_online_cpus()") made cpuset_hotplug_workfn asynchronous, This change involves calling flush_work(), which can create a multiple processes circular locking dependency that involve cgroup_mutex, potentially leading to a deadlock. To avoid deadlock. the commit 76bb5ab8f6e3 ("cpuset: break kernfs active protection in cpuset_write_resmask()") added 'kernfs_break_active_protection' in the cpuset_write_resmask. This could lead to this warning. After the commit 2125c0034c5d ("cgroup/cpuset: Make cpuset hotplug processing synchronous"), the cpuset_write_resmask no longer needs to wait the hotplug to finish, which means that concurrent hotplug and cpuset operations are no longer possible. Therefore, the deadlock doesn't exist anymore and it does not have to 'break active protection' now. To fix this warning, just remove kernfs_break_active_protection operation in the 'cpuset_write_resmask'.

AI-Powered Analysis

AILast updated: 06/30/2025, 15:58:23 UTC

Technical Analysis

CVE-2025-21634 is a vulnerability in the Linux kernel related to the cgroup cpuset subsystem and its handling of kernfs active protection. The issue arises from a race condition and concurrency problem when modifying cpuset.cpus while concurrently removing the associated cgroup. Specifically, the vulnerability is triggered by the use of 'kernfs_break_active_protection' during writes to cpuset.cpus, which was introduced as a workaround to avoid deadlocks caused by asynchronous cpuset hotplug processing. The root cause stems from a series of kernel commits: initially, asynchronous cpuset hotplug work (commit 3a5a6d0c2b03) introduced potential circular locking dependencies involving cgroup_mutex, risking deadlocks. To mitigate this, 'kernfs_break_active_protection' was added (commit 76bb5ab8f6e3) to break active protection during cpuset_write_resmask operations. However, this introduced a warning and potential instability when concurrent operations occur. Later, the cpuset hotplug processing was made synchronous again (commit 2125c0034c5d), eliminating the deadlock risk and removing the need for 'kernfs_break_active_protection'. The vulnerability manifests as a kernel warning and potential instability when rmdir operations on cgroups coincide with writes to cpuset.cpus, due to improper handling of kernfs active state. While no direct exploit in the wild is known, the issue could lead to kernel warnings, potential deadlocks, or race conditions affecting system stability and availability. The fix involves removing the 'kernfs_break_active_protection' call in cpuset_write_resmask to align with the synchronous hotplug processing, thus preventing the race condition and warning. This vulnerability affects Linux kernel versions containing the specified commits and is relevant to systems using cgroup cpuset features for CPU resource management.

Potential Impact

For European organizations, the impact of CVE-2025-21634 primarily concerns system stability and availability on Linux servers utilizing cgroup cpuset functionality. Many enterprise and cloud environments in Europe rely heavily on Linux for critical infrastructure, including web servers, container orchestration platforms (e.g., Kubernetes), and virtualized environments where cgroups manage CPU resource allocation. A race condition or deadlock in the kernel could cause system hangs, degraded performance, or forced reboots, disrupting business operations and service availability. While there is no evidence of direct exploitation or confidentiality breaches, the potential for denial-of-service conditions through kernel instability poses a significant risk. Organizations running high-density virtualized or containerized workloads with dynamic CPU resource adjustments are particularly vulnerable. Additionally, the complexity of the underlying kernel code and concurrency issues may complicate incident response and recovery. Given the widespread use of Linux in European data centers, cloud providers, and critical infrastructure, unpatched systems could face operational disruptions, impacting sectors such as finance, telecommunications, healthcare, and government services.

Mitigation Recommendations

To mitigate CVE-2025-21634, European organizations should: 1) Apply the official Linux kernel patches that remove the 'kernfs_break_active_protection' call in cpuset_write_resmask and restore synchronous cpuset hotplug processing as per commit 2125c0034c5d. 2) Prioritize patching Linux kernel versions that include the vulnerable commits (notably 76bb5ab8f6e3) to ensure the race condition and warning are resolved. 3) Audit and monitor systems for kernel warnings related to kernfs and cgroup cpuset operations to detect potential exploitation or instability. 4) Limit concurrent modifications to cpuset.cpus and cgroup removals in automated orchestration scripts or container management tools to reduce race conditions until patches are applied. 5) Test kernel updates in staging environments to verify stability in workloads that heavily utilize cgroup cpuset features. 6) Engage with Linux distribution vendors for backported patches if using long-term support kernels. 7) Implement robust system monitoring and alerting to quickly identify and respond to kernel deadlocks or performance anomalies. These steps go beyond generic advice by focusing on the specific kernel subsystems and concurrency issues involved in this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.726Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe96ea

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

Last enriched: 6/30/2025, 3:58:23 PM

Last updated: 8/12/2025, 10:16:45 AM

Views: 12

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