CVE-2024-40909: bpf: Fix a potential use-after-free in bpf_link_free()
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix a potential use-after-free in bpf_link_free()
After commit 1a80dbcb2dba, bpf_link can be freed by
link->ops->dealloc_deferred, but the code still tests and uses
link->ops->dealloc afterward, which leads to a use-after-free as
reported by syzbot. Actually, one of them should be sufficient, so
just call one of them instead of both. Also add a WARN_ON() in case
of any problematic implementation.
Security readout for executives and security teams
Plain-English summary
A Linux kernel flaw can access a BPF link after it has been freed, potentially causing a crash or enabling a local low-privileged attacker to compromise confidentiality, integrity, and availability. The supplied CVSS score is 7.8. Exposure depends on the running kernel build and whether its vendor has backported the correction.
Executive priority
Treat as a high-priority kernel maintenance issue, especially on shared or multi-user Linux systems. It does not warrant an internet-wide emergency response based on supplied evidence, because exploitation requires local access and active exploitation is unconfirmed.
Technical view
After the deferred deallocation callback frees a bpf_link, bpf_link_free() could still inspect and invoke the ordinary deallocation callback through the freed object. The correction makes these callbacks mutually exclusive and adds a warning for problematic implementations. The issue was reported by syzbot.
Likely exposure
The CVSS vector requires local access and low privileges, without user interaction. Internet reachability alone does not establish exposure. The supplied version data is difficult to interpret reliably, so Linux systems should be evaluated using their exact kernel package and vendor backport status rather than version numbers alone.
Exploitation context
The source bundle does not list this CVE in CISA KEV and provides no evidence of active exploitation or a public weaponized exploit. A syzbot report supports the existence of the memory-safety bug, but does not establish malicious exploitation.
Researcher notes
The vulnerable sequence follows commit 1a80dbcb2dba: dealloc_deferred may free the link before later access to link->ops->dealloc. The patch selects only one deallocation path and adds WARN_ON validation. The bundle provides three stable-tree commits, suggesting branch-specific backports; confirm ancestry against the deployed kernel source.
Mitigation direction
Update to a vendor-supported kernel containing the applicable upstream stable correction or equivalent backport.
Check distribution security guidance for package-specific remediation and reboot requirements.
Prioritize multi-user systems where low-privileged local users can access affected kernel functionality.
Limit untrusted local access until the corrected kernel is installed, where operationally feasible.
Validation and detection
Inventory each host's running kernel version and distribution package build.
Verify the installed package contains an applicable listed fix commit or vendor-equivalent backport.
Confirm each remediated host is running the corrected kernel, not merely storing it on disk.
Review vendor advisories because the supplied affected-version data does not cleanly map distribution kernels.
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.
cve · low confidence lookup
CVE-2024-40909 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
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.