CVE-2025-21811
Published: 27 February 2025
Summary
CVE-2025-21811 is a high-severity Use After Free (CWE-416) vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 7.5th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-2 (Flaw Remediation) and CM-7 (Least Functionality).
Deeper analysis
CVE-2025-21811 is a use-after-free vulnerability (CWE-416) in the Linux kernel's nilfs2 filesystem. The issue affects the nilfs_lookup_dirty_data_buffers() function, which iterates through buffers attached to dirty data folios or pages without properly locking them. This creates a race condition where buffers can lose their dirty state protection asynchronously via nilfs_clear_folio_dirty() during filesystem degeneration to read-only mode, leading to unintentional freeing by try_to_free_buffers() and subsequent use-after-free access. The vulnerability has a CVSS v3.1 base score of 7.8.
A local attacker with low privileges (AV:L/AC:L/PR:L/UI:N/S:U) can exploit this flaw. Successful exploitation could result in high impacts to confidentiality, integrity, and availability (C:H/I:H/A:H), potentially allowing arbitrary code execution, data corruption, or system crashes on systems using the nilfs2 filesystem.
Mitigation involves applying kernel patches from the referenced stable commits, which adjust the lock section in nilfs_lookup_dirty_data_buffers() to protect buffer access. The patches are available at: https://git.kernel.org/stable/c/367a9bffabe08c04f6d725032cce3d891b2b9e1a, https://git.kernel.org/stable/c/4b08d23d7d1917bef4fbee8ad81372f49b006656, https://git.kernel.org/stable/c/58c27fa7a610b6e8d44e6220e7dbddfbaccaf439, https://git.kernel.org/stable/c/72cf688d0ce7e642b12ddc9b2a42524737ec1b4a, and https://git.kernel.org/stable/c/8e1b9201c9a24638cf09c6e1c9f224157328010b.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2025-5976
Vulnerability details
In the Linux kernel, the following vulnerability has been resolved: nilfs2: protect access to buffers with no active references nilfs_lookup_dirty_data_buffers(), which iterates through the buffers attached to dirty data folios/pages, accesses the attached buffers without locking the folios/pages. For data…
more
cache, nilfs_clear_folio_dirty() may be called asynchronously when the file system degenerates to read only, so nilfs_lookup_dirty_data_buffers() still has the potential to cause use after free issues when buffers lose the protection of their dirty state midway due to this asynchronous clearing and are unintentionally freed by try_to_free_buffers(). Eliminate this race issue by adjusting the lock section in this function.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
Use-after-free in Linux kernel nilfs2 allows local low-priv attacker to achieve arbitrary code execution via race condition, directly enabling exploitation for privilege escalation.
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly mandates identification, reporting, and correction of the use-after-free flaw in nilfs2 via timely kernel patching as specified in the CVE mitigation.
Implements memory safeguards like address space layout randomization and data execution protection to mitigate exploitation of the kernel use-after-free race condition.
Restricts or prohibits non-essential nilfs2 filesystem functionality, preventing local attackers from triggering the vulnerability on systems where it is not required.