Re: [PATCH net v3] vxlan: keep the last remote linked during FDB flush

From: Ido Schimmel

Date: Mon Aug 10 2026 - 12:09:23 EST


On Mon, Aug 10, 2026 at 02:41:14PM +0000, David Lee wrote:
> From: Kyle Zeng <kylebot@xxxxxxxxxx>
>
> A non-nexthop FDB entry is expected to have at least one remote while it
> remains reachable through the FDB hash table. A filtered bulk flush
> violates this invariant when every remote matches: It unlinks the last
> remote in vxlan_fdb_dst_destroy() and only afterwards tells vxlan_flush()
> to destroy the parent FDB entry.
>
> An RCU reader can find the parent during this interval.
> first_remote_rcu() then applies list_entry_rcu() to the empty list head,
> producing an invalid remote pointer that the receive learning path can
> read from and write to.
>
> When a matching remote is the sole remaining remote, leave it linked and
> ask the caller to destroy the entire FDB entry. vxlan_fdb_destroy() keeps
> the remote attached while sending the deletion notification and removing
> the parent from the lookup structures.
>
> Fixes: c499fccb71cb ("vxlan: vxlan_core: Support FDB flushing by destination VNI")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Ido Schimmel <idosch@xxxxxxxxxx>

This tag is not really appropriate here since I didn't suggest the fix,
but only a small cleanup. Anyway, not a big deal.

> Assisted-by: Codex:gpt-5.6-sol Codex:gpt-5.5-cyber
> Signed-off-by: Kyle Zeng <kylebot@xxxxxxxxxx>
> Co-developed-by: David Lee <david.lee@xxxxxxxxxxxxxxx>
> Signed-off-by: David Lee <david.lee@xxxxxxxxxxxxxxx>

Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>