CVE-2025-21853
kernel: bpf: avoid holding freeze_mutex during mmap operation
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 12, 2025
Updated · October 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf: avoid holding freeze_mutex during mmap operation
We use map->freeze_mutex to prevent races between map_freeze() and memory mapping BPF map contents with writable permissions. The way we naively do this means we'll hold freeze_mutex for entire duration of all the mm and VMA manipulations, which is completely unnecessary. This can potentially also lead to deadlocks, as reported by syzbot in [0].
So, instead, hold freeze_mutex only during writeability checks, bump (proactively) "write active" count for the map, unlock the mutex and proceed with mmap logic. And only if something went wrong during mmap logic, then undo that "write active" counter increment.
[0] https://lore.kernel.org/bpf/[email protected]/
Statement
This vulnerability is rated as Moderate impact for Red Hat Enterprise Linux because exploiting it requires local execution with administrative privileges to cause a deadlock, resulting strictly in a denial of service. On default installations, unprivileged eBPF is disabled, requiring an attacker to already possess elevated capabilities such as CAP_BPF or CAP_SYS_ADMIN to interact with BPF maps and memory mappings simultaneously. Because this flaw cannot lead to privilege escalation or data compromise, the risk is confined to system availability.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 4.4CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
CWE-833 · Deadlock