bridge/vxlan: fix reading neigh ha without synchronization
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 4 repliesApplied 2/2
- v12 patches 2 repliesSuperseded
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: bridge: arp/nd proxy: fix reading neigh hanet/ | +14 | 2 replies | Applied |
| 2/2 | vxlan: fix reading neigh hadrivers/ | +13 | 2 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Petr Machata | Ido Schimmel |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net v2 0/2] bridge/vxlan: fix reading neigh ha without synchronization
Hi,
Neigh ha address must be read using the seqlock to get a stable snapshot. Both the bridge and vxlan read it directly and can see partial updates. I reproduced both issues with running neigh updates and exercising these paths in parallel and saw partial addresses, e.g. updating between neigh A: 02:00:00:00:00:00 neigh B: fe:ff:ff:ff:ff:ff was able to observe 02:00:ff:ff:ff:ff and fe:ff:00:00:00:00 in packets. Noticed this initially in the bridge, then checked vxlan and its arp/neigh_reduce functions have the same bug, route_shortcircuit is doing the right thing already.
v1 link: https://lore.kernel.org/netdev/[email protected]/
v2: - use ETH_ALEN instead of MAX_ADDR_LEN, the bridge devices all use
ETH_ALEN and vxlan allows arp/nd reduce only when not in raw/gpe so it also always uses ETH_ALEN
- align ha to 2 bytes because ether_addr_copy() expects it (Sashiko)
2-byte alignment is not strictly necessary everywhere (e.g. the ARP suppress side can't reach ether_addr_copy) but it doesn't cost us anything and is aligned with the rest of the code.
Cheers,
Nik
Nikolay Aleksandrov (2):
net: bridge: arp/nd proxy: fix reading neigh ha
vxlan: fix reading neigh ha
drivers/net/vxlan/vxlan_core.c | 20 +++++++++++++------- net/bridge/br_arp_nd_proxy.c | 24 ++++++++++++++---------- 2 files changed, 27 insertions(+), 17 deletions(-)
Signature · 1 line
2.47.3