CVE-2021-4001
Linux Kernel vulnerability analysis and mitigation

Overview

A race condition vulnerability (CVE-2021-4001) was discovered in the Linux kernel's eBPF verifier between bpfmapupdateelem and bpfmap_freeze operations due to a missing lock in kernel/bpf/syscall.c. The vulnerability affects Linux kernel versions prior to 5.16 rc2, discovered in late 2021 (NVD, Ubuntu).

Technical details

The vulnerability stems from a race condition in the eBPF implementation where a missing lock in kernel/bpf/syscall.c allows modification of frozen mapped address space. The issue has a CVSS v3.1 Base Score of 4.1 (Medium) with vector: CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N. The vulnerability is classified as a Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367) (NVD).

Impact

A local user with special privileges (capsysadmin or cap_bpf) can exploit this vulnerability to modify read-only maps that should be immutable. This could potentially lead to unauthorized modifications of frozen mapped address space, affecting the system's security guarantees (Kernel Patch).

Mitigation and workarounds

The vulnerability was fixed in Linux kernel version 5.16 rc2 by expanding the use of the map's map->writecnt and converting it into an atomic64 to prevent double freezemutex mutex{un,}lock() pairs. The fix ensures that all pending writes must complete before map content can be used as known constants (Kernel Patch).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-40258HIGH7
  • Linux KernelLinux Kernel
  • kernel-rt-64k-debug-devel-matched
NoNoDec 04, 2025
CVE-2025-40259MEDIUM6.2
  • Linux KernelLinux Kernel
  • kernel-rt-64k
NoNoDec 04, 2025
CVE-2025-40264MEDIUM5.5
  • Linux KernelLinux Kernel
  • kernel-64k-modules-extra
NoNoDec 04, 2025
CVE-2025-40254MEDIUM5.5
  • Linux KernelLinux Kernel
  • kernel-64k-devel-matched
NoNoDec 04, 2025
CVE-2025-40253MEDIUM5.5
  • Linux KernelLinux Kernel
  • kernel-64k-debug-modules-partner
NoNoDec 04, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management