CVE-2025-40183
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix metadata_dst leak __bpf_redirect_neigh_v{4,6}
Cilium has a BPF egress gateway feature which forces outgoing K8s Pod traffic to pass through dedicated egress gateways which then SNAT the traffic in order to interact with stable IPs outside the cluster.
The traffic is directed to the gateway via vxlan tunnel in collect md mode. A recent BPF change utilized the bpf_redirect_neigh() helper to forward packets after the arrival and decap on vxlan, which turned out over time that the kmalloc-256 slab usage in kernel was ever-increasing.
The issue was that vxlan allocates the metadata_dst object and attaches it through a fake dst entry to the skb. The latter was never released though given bpf_redirect_neigh() was merely setting the new dst entry via skb_dst_set() without dropping an existing one first.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A memory leak in the Linux kernel, the bpf_redirect_neigh() helpers leak a metadata_dst object, causing a kernel memory leak that can exhaust slab memory over time.
In the Linux kernel, CVE-2025-40183 is a memory leak vulnerability in the BPF infrastructure, specifically within the __bpf_redirect_neigh_v4 and __bpf_redirect_neigh_v6 helper functions. The root cause is a failure to properly release a metadata_dst object that is attached to an skb via a fake dst entry. When VXLAN tunnels are used in collect metadata mode, they allocate a metadata_dst and attach it to the packet; the BPF redirect helpers, however, overwrite the dst entry using skb_dst_set() without first dropping the existing one, leading to a persistent leak of the metadata_dst object.
The vulnerability is exploitable by triggering BPF programs that use the bpf_redirect_neigh() helper on VXLAN-decapsulated packets. The attack surface involves systems with eBPF programs (such as those in Cilium's egress gateway feature) that redirect traffic through tunnels in collect metadata mode. No authentication is needed to trigger the path itself, but the attacker must be able to control or influence network traffic that is processed by such BPF programs, typically from a compromised pod or from outside the cluster boundary.
Over time, this leak causes the kernel's kmalloc-256 slab to continuously grow, as each redirected packet allocates a metadata_dst that is never freed. This leads to kernel memory exhaustion, potentially causing system instability or denial-of-service conditions. The kernel may eventually trigger out-of-memory (OOM) killer actions, impacting all processes on the system.
The vulnerability has been fixed by adding an explicit skb_dst_drop() call before skb_dst_set() in the bpf_redirect_neigh helpers [1][3]. It affects kernel versions including but not limited to those with commit 057764172fcc [1] and 23f3770e1a53 [2]. Users should update to a corrected kernel version; no workaround is known other than avoiding use of the affected BPF helpers or ensuring the patch is applied.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
73fba965a9aac057764172fcc2e67c2037382b6bfe44b6dbbf36a305d30f57404ce888a4523f3770e1a53Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- git.kernel.org/stable/c/057764172fcc6ee2ccb6c41351a55a9f054dc8fdnvd
- git.kernel.org/stable/c/23f3770e1a53e6c7a553135011f547209e141e72nvd
- git.kernel.org/stable/c/2e67c2037382abb56497bb9d7b7e10be04eb5598nvd
- git.kernel.org/stable/c/3fba965a9aac0fa3cbd8138436a37af9ab466d79nvd
- git.kernel.org/stable/c/7404ce888a45eb7da0508b7cbbe6f2e95302eeb8nvd
- git.kernel.org/stable/c/b6bfe44b6dbb14a31d86c475cdc9c7689534fb09nvd
- git.kernel.org/stable/c/f36a305d30f557306d87c787ddffe094ac5dac89nvd
News mentions
0No linked articles in our index yet.