[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44ca44bb-a641-4d70-ad7a-96a3187706a3@linux.dev>
Date: Fri, 3 Oct 2025 11:50:23 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
Yusuke Suzuki <yusuke.suzuki@...valent.com>,
Julian Wiedmann <jwi@...valent.com>, Martin KaFai Lau
<martin.lau@...nel.org>, Jakub Kicinski <kuba@...nel.org>,
Jordan Rife <jrife@...gle.com>
Subject: Re: [PATCH bpf] bpf: Fix metadata_dst leak
__bpf_redirect_neigh_v{4,6}
On 10/3/25 12:34 AM, Daniel Borkmann wrote:
> 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.
Reviewed-by: Martin KaFai Lau <martin.lau@...nel.org>
Powered by blists - more mailing lists