]> git.ipfire.org Git - thirdparty/linux.git/commit
vxlan: use neigh_ha_snapshot() in route_shortcircuit()
authorEric Dumazet <edumazet@google.com>
Thu, 23 Jul 2026 14:42:47 +0000 (14:42 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 27 Jul 2026 22:15:13 +0000 (15:15 -0700)
commit8eca411347e1d38964f9ed2c8d3b6ab0e7e4473d
treebc988f54a17af34c9cb7dc4bf8c5b02a102ea282
parent760d36e737f2b3867762f42af36c663f55babcc4
vxlan: use neigh_ha_snapshot() in route_shortcircuit()

The neighbour hardware address n->ha can be updated asynchronously by the
neighbour subsystem, protected by n->ha_lock seqlock. Reading n->ha without
holding the seqlock loop can lead to torn reads or reading a partially updated
MAC address.

Use neigh_ha_snapshot() in route_shortcircuit() to safely copy n->ha under
read_seqbegin()/read_seqretry() lock protection before using it.

Note that arp_reduce() and neigh_reduce() seem to have the same issue
left for future patches.

Fixes: e4f67addf158 ("add DOVE extensions for VXLAN")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20260723144249.759100-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/vxlan/vxlan_core.c