udplookup: Rescan udp hash chains if cross-linked
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | udp4: Rescan udp hash chains if cross-linked.net/ | +17 | 2 replies | |
| 2/2 | udp6: Rescan udp hash chains if cross-linked.net/ | +19 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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