Cyber Posture

CVE-2025-21811

High

Published: 27 February 2025

Published
27 February 2025
Modified
03 November 2025
KEV Added
Patch
CVSS Score 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0003 8.0th percentile
Risk Priority 16 60% EPSS · 20% KEV · 20% CVSS

Description

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 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.

Security Summary

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.

Details

CWE(s)
CWE-416

Affected Products

linux
linux kernel
3.10 — 5.4.291 · 5.5 — 5.10.235 · 5.11 — 5.15.179

References