netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] vxlan: Fix NPDs when using nexthop objects
@ 2025-09-01  6:50 Ido Schimmel
  2025-09-01  6:50 ` [PATCH net 1/3] vxlan: Fix NPD when refreshing an FDB entry with a nexthop object Ido Schimmel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ido Schimmel @ 2025-09-01  6:50 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, horms, razor, petrm,
	mcremers, Ido Schimmel

With FDB nexthop groups, VXLAN FDB entries do not necessarily point to a
remote destination but rather to an FDB nexthop group. This means that
first_remote_{rcu,rtnl}() can return NULL and a few places in the driver
were not ready for that, resulting in NULL pointer dereferences.
Patches #1-#2 fix these NPDs.

Note that vxlan_fdb_find_uc() still dereferences the remote returned by
first_remote_rcu() without checking that it is not NULL, but this
function is only invoked by a single driver which vetoes the creation of
FDB nexthop groups. I will patch this in net-next to make the code less
fragile.

Patch #3 adds a selftests which exercises these code paths and tests
basic Tx functionality with FDB nexthop groups. I verified that the test
crashes the kernel without the first two patches.

Ido Schimmel (3):
  vxlan: Fix NPD when refreshing an FDB entry with a nexthop object
  vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objects
  selftests: net: Add a selftest for VXLAN with FDB nexthop groups

 drivers/net/vxlan/vxlan_core.c               |  18 +-
 drivers/net/vxlan/vxlan_private.h            |   4 +-
 tools/testing/selftests/net/Makefile         |   1 +
 tools/testing/selftests/net/test_vxlan_nh.sh | 223 +++++++++++++++++++
 4 files changed, 237 insertions(+), 9 deletions(-)
 create mode 100755 tools/testing/selftests/net/test_vxlan_nh.sh

-- 
2.51.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-09-03  0:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01  6:50 [PATCH net 0/3] vxlan: Fix NPDs when using nexthop objects Ido Schimmel
2025-09-01  6:50 ` [PATCH net 1/3] vxlan: Fix NPD when refreshing an FDB entry with a nexthop object Ido Schimmel
2025-09-02 12:16   ` Nikolay Aleksandrov
2025-09-01  6:50 ` [PATCH net 2/3] vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objects Ido Schimmel
2025-09-02 12:17   ` Nikolay Aleksandrov
2025-09-01  6:50 ` [PATCH net 3/3] selftests: net: Add a selftest for VXLAN with FDB nexthop groups Ido Schimmel
2025-09-02 12:17   ` Nikolay Aleksandrov
2025-09-03  0:10 ` [PATCH net 0/3] vxlan: Fix NPDs when using nexthop objects patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).