Skip to content

udplookup: Rescan udp hash chains if cross-linked

David Laight lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2udp4: Rescan udp hash chains if cross-linked.net/ipv4/udp.c+17 -22 replies
2/2udp6: Rescan udp hash chains if cross-linked.net/ipv6/udp.c+19 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] udplookup: Rescan udp hash chains if cross-linked

udp_lib_rehash() can get called at any time and will move a socket to a different hash2 chain.
This can cause udp[46]_lib_lookup2() (processing incoming UDP) to fail to find a socket and an ICMP port unreachable be sent.

Prior to ca065d0cf80fa the lookup used 'hlist_nulls' and checked that the 'end if list' marker was on the correct list.

The cross-linking can definitely happen (see earlier issues with it looping forever because gcc cached the list head).

I can't see an easy way around adding another two parameters to udp[46]_lib lookup().
However once udp-lite is removed 'mask' can be obtained from 'net'. 'net' itself could be obtained from 'sk'.

Not addressed here, but the 'reuseport' code doesn't look right to me.

David Laight (2):
IPv4: Rescan the hash2 list if the hash chains have got cross-linked.
IPv6: Rescan the hash2 list if the hash chains have got cross-linked.

 net/ipv4/udp.c | 19 +++++++++++++++++--
 net/ipv6/udp.c | 22 +++++++++++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.5