CVE-2023-53221: bpf: Fix memleak due to fentry attach failure
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix memleak due to fentry attach failure
If it fails to attach fentry, the allocated bpf trampoline image will be
left in the system. That can be verified by checking /proc/kallsyms.
This meamleak can be verified by a simple bpf program as follows:
SEC("fentry/trap_init")
int fentry_run()
{
return 0;
}
It will fail to attach trap_init because this function is freed after
kernel init, and then we can find the trampoline image is left in the
system by checking /proc/kallsyms.
$ tail /proc/kallsyms
ffffffffc0613000 t bpf_trampoline_6442453466_1 [bpf]
ffffffffc06c3000 t bpf_trampoline_6442453466_1 [bpf]
$ bpftool btf dump file /sys/kernel/btf/vmlinux | grep "FUNC 'trap_init'"
[2522] FUNC 'trap_init' type_id=119 linkage=static
$ echo $((6442453466 & 0x7fffffff))
2522
Note that there are two left bpf trampoline images, that is because the
libbpf will fallback to raw tracepoint if -EINVAL is returned.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel memory leak in BPF fentry attach failure handling. A local user with BPF-loading privileges could leave allocated trampoline images behind, consuming kernel memory and potentially affecting system availability. The provided sources rate it medium severity and do not indicate confidentiality or integrity impact.
Executive priority
Treat as a scheduled but real availability risk, especially for multi-user Linux servers and container hosts. It does not justify emergency response from the provided evidence, but should be included in normal kernel patch cycles and prioritized where untrusted local code runs.
Technical view
When an fentry attach operation fails, the kernel can fail to free the allocated BPF trampoline image. The CVE describes leftover trampoline images visible in kernel symbols after failed attach attempts. It is CWE-401, with CVSS 5.5: local, low complexity, low privileges, no user interaction, availability impact only.
Likely exposure
Exposure is most likely on Linux systems running affected kernels with BPF functionality available to local users or workloads. Public network exposure is not the primary concern. Exact distribution impact depends on whether the vendor kernel includes one of the stable fixes or equivalent backports.
Exploitation context
The bundle does not report active exploitation, and KEV is false. The described abuse requires local access and BPF-loading capability. The public description includes proof of the leak condition, but no evidence here supports remote exploitation or privilege escalation.
Researcher notes
The source identifies a BPF trampoline image lifetime bug on fentry attach failure. Affected-version evidence is kernel-level and commit-oriented, so downstream vendor kernels need separate verification. Do not infer remote reachability, data exposure, or exploit-in-the-wild status from this bundle.
Mitigation direction
Update to a vendor-supported kernel containing the linked stable fixes or equivalent backports.
Check Linux distribution advisories for package-specific fixed versions.
Restrict BPF loading to trusted administrators where operationally feasible.
Prioritize shared hosts, container platforms, and systems running untrusted local workloads.
Validation and detection
Inventory kernel versions and vendor patch status across Linux fleets.
Confirm whether BPF use is enabled and who can load BPF programs.
Map affected systems against distribution advisories and stable kernel fixes.
Monitor for unusual kernel memory pressure on systems awaiting patching.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.