From: David Laight <david.laight.linux@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: David Laight <david.laight.linux@gmail.com>,
David Ahern <dsahern@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Tom Herbert <tom@herbertland.com>,
Gabriel Krisman Bertazi <krisman@suse.de>,
Lorenz Bauer <lmb@isovalent.com>,
Kuniyuki Iwashima <kuniyu@amazon.com>
Subject: [PATCH net 0/2] udplookup: Rescan udp hash chains if cross-linked
Date: Mon, 27 Jan 2025 19:40:22 +0000 [thread overview]
Message-ID: <20250127194024.3647-1-david.laight.linux@gmail.com> (raw)
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(-)
--
2.39.5
next reply other threads:[~2025-01-27 19:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 19:40 David Laight [this message]
2025-01-27 19:40 ` [PATCH net 1/2] udp4: Rescan udp hash chains if cross-linked David Laight
2025-01-27 19:40 ` [PATCH net 2/2] udp6: " David Laight
2025-01-27 20:33 ` [PATCH net 1/2] udp4: " Kuniyuki Iwashima
2025-01-27 21:26 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250127194024.3647-1-david.laight.linux@gmail.com \
--to=david.laight.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=krisman@suse.de \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lmb@isovalent.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tom@herbertland.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).