Skip to content

vxlan: Fix NPDs when using nexthop objects

Ido Schimmel netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3vxlan: Fix NPD when refreshing an FDB entry with a nexthop objectdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h+5 -71 replyApplied
2/3vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objectsdrivers/net/vxlan/vxlan_core.c+8 -21 replyApplied
3/3selftests: net: Add a selftest for VXLAN with FDB nexthop groupstools/testing/selftests/net/Makefile tools/testing/selftests/net/test_vxlan_nh.sh+224 -01 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPetr MachataNikolay Aleksandrov
1/3R-b R-b
2/3R-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/3] vxlan: Fix NPDs when using nexthop objects

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
Signature · 1 line
2.51.0