HIGH 7.8

CVE-2026-52991: Linux Kernel Cgroup Use-After-Free Race Condition (CVSS 7.8)

CVE-2026-52991 is a use-after-free vulnerability in the Linux kernel's process scheduler and cgroup subsystem. The flaw occurs when a process tries to write pressure metrics to a cgroup control file at the same moment the cgroup is being deleted on another CPU. This timing collision can cause the kernel to access memory that has already been freed, potentially leading to system crashes or privilege escalation. The vulnerability requires local access and does not require special permissions, making it a meaningful threat in multi-tenant or shared-system environments.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.8 HIGH · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-362, CWE-367
Affected products
2 configuration(s)
Published / Modified
2026-06-24 / 2026-07-15

NVD description (verbatim)

In the Linux kernel, the following vulnerability has been resolved: sched/psi: fix race between file release and pressure write A potential race condition exists between pressure write and cgroup file release regarding the priv member of struct kernfs_open_file, which triggers the uaf reported in [1]. Consider the following scenario involving execution on two separate CPUs: CPU0 CPU1 ==== ==== vfs_rmdir() kernfs_iop_rmdir() cgroup_rmdir() cgroup_kn_lock_live() cgroup_destroy_locked() cgroup_addrm_files() cgroup_rm_file() kernfs_remove_by_name() kernfs_remove_by_name_ns() vfs_write() __kernfs_remove() new_sync_write() kernfs_drain() kernfs_fop_write_iter() kernfs_drain_open_files() cgroup_file_write() kernfs_release_file() pressure_write() cgroup_file_release() ctx = of->priv; kfree(ctx); of->priv = NULL; cgroup_kn_unlock() cgroup_kn_lock_live() cgroup_get(cgrp) cgroup_kn_unlock() if (ctx->psi.trigger) // here, trigger uaf for ctx, that is of->priv The cgroup_rmdir() is protected by the cgroup_mutex, it also safeguards the memory deallocation of of->priv performed within cgroup_file_release(). However, the operations involving of->priv executed within pressure_write() are not entirely covered by the protection of cgroup_mutex. Consequently, if the code in pressure_write(), specifically the section handling the ctx variable executes after cgroup_file_release() has completed, a uaf vulnerability involving of->priv is triggered. Therefore, the issue can be resolved by extending the scope of the cgroup_mutex lock within pressure_write() to encompass all code paths involving of->priv, thereby properly synchronizing the race condition occurring between cgroup_file_release() and pressure_write(). And, if an live kn lock can be successfully acquired while executing the pressure write operation, it indicates that the cgroup deletion process has not yet reached its final stage; consequently, the priv pointer within open_file cannot be NULL. Therefore, the operation to retrieve the ctx value must be moved to a point *after* the live kn lock has been successfully acquired. In another situation, specifically after entering cgroup_kn_lock_live() but before acquiring cgroup_mutex, there exists a different class of race condition: CPU0: write memory.pressure CPU1: write cgroup.pressure=0 =========================== ============================= kernfs_fop_write_iter() kernfs_get_active_of(of) pressure_write() cgroup_kn_lock_live(memory.pressure) cgroup_tryget(cgrp) kernfs_break_active_protection(kn) ... blocks on cgroup_mutex cgroup_pressure_write() cgroup_kn_lock_live(cgroup.pressure) cgroup_file_show(memory.pressure, false) kernfs_show(false) kernfs_drain_open_files() cgroup_file_release(of) kfree(ctx) of->priv = NULL cgroup_kn_unlock() ... acquires cgroup_mutex ctx = of->priv; // may now be NULL if (ctx->psi.trigger) // NULL dereference Consequently, there is a possibility that of->priv is NULL, the pressure write needs to check for this. Now that the scope of the cgroup_mutex has been expanded, the original explicit cgroup_get/put operations are no longer necessary, this is because acquiring/releasing the live kn lock inherently executes a cgroup get/put operation. [1] BUG: KASAN: slab-use-after-free in pressure_write+0xa4/0x210 kernel/cgroup/cgroup.c:4011 Call Trace: pressure_write+0xa4/0x210 kernel/cgroup/cgroup.c:4011 cgroup_file_write+0x36f/0x790 kernel/cgroup/cgroup.c:43 ---truncated---

6 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the cgroup pressure write path where a race condition allows access to a freed priv structure member of kernfs_open_file. The issue manifests in two scenarios: (1) pressure_write() accesses of->priv after cgroup_file_release() has deallocated and nullified it, and (2) a derivation where cgroup_file_show() can trigger file release between cgroup_kn_lock_live() and the subsequent cgroup_mutex acquisition, leaving of->priv in a potentially NULL state. The root cause is inadequate mutual exclusion—the cgroup_mutex does not fully protect all code paths that read of->priv within pressure_write(). The fix extends cgroup_mutex coverage to encompass all priv accesses, defers the ctx retrieval to after the live kernel-ns (kn) lock is held (ensuring the priv pointer is valid), and adds a NULL check to handle the derivative race condition.

Business impact

An unprivileged local attacker can trigger a kernel use-after-free condition, resulting in denial of service (system crash) or potential privilege escalation. In containerized or virtualized environments where multiple tenants share a kernel, this becomes a lateral privilege escalation vector. The impact is high severity because it requires only local user privileges and no user interaction, affecting the stability and security boundary of the kernel itself.

Affected systems

All Linux kernel versions containing the vulnerable pressure_write() implementation in kernel/cgroup/cgroup.c are affected. The specific range requires verification against the Linux kernel source history, as patch version data is not provided in the advisory. Affected systems include any running a vulnerable kernel version with CONFIG_PSI enabled and cgroup v2 support, which is increasingly common in modern distributions.

Exploitability

Exploitability is straightforward for a local attacker. The race condition is relatively easy to trigger under typical multi-core conditions due to the tight timing window involved in concurrent cgroup deletion and pressure metric writes. No special kernel configuration, privileges beyond standard local user, or complex gadget chains are required. However, successful exploitation depends on precise CPU scheduling alignment, which may require repeated attempts or specialized timing techniques.

Remediation

Apply the kernel patch that extends cgroup_mutex protection within pressure_write() to cover all of->priv accesses, moves the ctx retrieval point to after cgroup_kn_lock_live() acquisition, and adds a NULL check for of->priv. This eliminates both race conditions by ensuring proper synchronization between pressure write operations and cgroup file release. Verify against the Linux kernel security advisory for the exact patch version and backport availability for your kernel series.

Patch guidance

Monitor Linux kernel security advisories and your distribution's kernel updates for a patch addressing CVE-2026-52991. If you maintain a custom or stable kernel, apply the upstream patch once released or backport the fix from the Linux kernel stable/mainline repository. Test the patched kernel in a non-production environment before rolling out to production systems, particularly in container orchestration or multi-tenant deployments where the race is more likely to manifest.

Detection guidance

Detection requires kernel-level monitoring. Enable KASAN (Kernel Address Sanitizer) or CONFIG_DEBUG_KMEMLEAK in development/testing environments to catch use-after-free conditions. In production, monitor kernel logs for KASAN warnings or BUG messages related to pressure_write() and cgroup file operations. Container runtime logs may show unexpected OOM or kernel panic events. Network-based detection is not feasible; focus on host-level kernel instrumentation and system stability metrics.

Why prioritize this

This vulnerability merits urgent attention because it affects core kernel scheduling and cgroup infrastructure with high CVSS (7.8), requires only local access, and has straightforward exploitability in multi-core systems. Kernel vulnerabilities are systemic—a single compromised system can cascade to affect containers or virtual machines sharing that kernel. Organizations running container platforms, shared hosting, or multi-tenant infrastructure should prioritize patching. It is not yet in the CISA KEV catalog, but that does not reduce its practical risk.

Risk score, explained

CVSS 7.8 (HIGH) reflects a local attack vector (AV:L), low complexity (AC:L), low privilege requirement (PR:L), no user interaction (UI:N), and high impact across confidentiality, integrity, and availability (C:H/I:H/A:H). The score appropriately captures the severity of an unprivileged local use-after-free that can crash the kernel or lead to privilege escalation, although the practical exploitability depends on race condition timing.

Frequently asked questions

Can this vulnerability be exploited remotely?

No. CVE-2026-52991 requires local access to trigger the race condition. An attacker must have an account or shell access on the affected system to write to cgroup control files or execute processes that interact with pressure metrics.

Do I need to patch if I run a single-user or single-process system?

While the race requires multi-core or concurrent execution to manifest, the vulnerability is still present in the kernel code. In shared infrastructure, container platforms, or any environment with concurrent workloads, patching is essential. Single-user systems have lower practical risk but should still be patched for security completeness.

What is the difference between CONFIG_PSI and CONFIG_CGROUP_V2?

CONFIG_PSI enables Pressure Stall Information, a kernel feature that tracks CPU, memory, and I/O pressure. CONFIG_CGROUP_V2 enables cgroups v2. Both must be enabled for the vulnerable code path to exist. Modern distributions typically enable both, so assume your system is affected unless you have explicitly disabled one of these at compile time.

Will this be assigned a CISA KEV entry?

The vulnerability is not yet in the CISA Known Exploited Vulnerabilities catalog as of the intelligence publication date. However, KEV status does not determine urgency for kernel vulnerabilities; the high CVSS, local attack vector, and ease of triggering make it a priority regardless of KEV designation.

This analysis is based on the vulnerability description provided and publicly available information current as of the publication date. Patch version numbers, specific affected kernel versions, and backport availability must be verified against the official Linux kernel security advisories and your distribution's vendor guidelines. CVSS scores and KEV status are derived from authoritative sources but may be updated by NIST or CISA. This explainer is intended for security professionals and does not constitute actionable legal or compliance advice. Organizations should validate all remediation steps in their own test environment before deploying to production. Source: NVD (public-domain), retrieved 2026-07-31. Analysis generated by SEC.co (claude-haiku-4-5).