bpf: Fix metadata_dst leak __bpf_redirect_neigh_v{4,6}
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b4ab31414970a7a03a5d55d75083f2c101a30592 · < 7404ce888a45eb7da0508b7cbbe6f2e95302eeb8| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's BPF neighbor-redirection helper fails to release an existing VXLAN metadata destination when forwarding a decapsulated packet. In the described Cilium egress-gateway setup, repeated traffic can cause kernel memory usage to grow; the input does not establish an attacker access requirement or user-interaction condition.
Operators running Linux kernels with Cilium BPF egress gateways that use VXLAN collect-metadata mode should check whether their kernel is affected; no affected versions are specified.