From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Zihan Xi" <zihanx@nebusec.ai>, <netdev@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>, <bpf@vger.kernel.org>
Cc: <willemdebruijn.kernel@gmail.com>, <davem@davemloft.net>,
<edumazet@kernel.org>, <pabeni@redhat.com>, <horms@kernel.org>,
<benh@amazon.com>, <kuniyu@google.com>, <shuah@kernel.org>,
<vega@nebusec.ai>
Subject: Re: [PATCH net 1/2] udp: fix reuseport rescore fallback
Date: Mon, 16 Nov 2026 04:51:50 +0000 [thread overview]
Message-ID: <DMWD65CI6NZ6.2V1UCWL1FUM8K@gmail.com> (raw)
In-Reply-To: <8c46325c4a433f02fdc7241c0c3884126cb502af.1794759652.git.zihanx@nebusec.ai>
On Sun, Nov 15, 2026 at 07:55 PM Zihan Xi <zihanx@nebusec.ai> wrote:
> When a reuseport group contains connected sockets, UDP lookup rescored the
> socket selected by the reuseport program. If that socket did not match the
> packet, lookup retained the stale selection while continuing the scan. This
> could deliver a packet to a socket connected to a different peer.
Not since 6.13, unless CONFIG_BASE_SMALL=y.
> Link: https://bugtracker.nebusec.ai/f/net/ipv6/udp.c||udp6_lib_lookup2||socket-hijack||m7q
That's not a hijack.
udp_reuseport_add_sock() lets only sockets of one uid into a group.
A member of the group attaches the prog.
The prog picks a wrong socket of its own user.
> + if (need_rescore) {
> + if (score > badness)
> + badness = score;
> + else
> + result = sk;
> + continue;
> + }
This makes it worse.
The unconnected sockets of a group have the same score.
So the score of the picked socket is equal to badness, and the patch
replaces the picked socket with sk.
Sockets A, B, C are not connected. A is the first one in hslot2.
has_conns is set:
reuseport picks today with the patch
--------------- ----- --------------
A A A
B B A
C C A
Nack.
next prev parent reply other threads:[~2026-11-16 4:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 3:55 [PATCH net 0/2] udp: fix connected reuseport rescore fallback Zihan Xi
2026-11-16 3:55 ` [PATCH net 1/2] udp: fix " Zihan Xi
2026-11-16 4:51 ` Alexei Starovoitov [this message]
2026-11-16 5:08 ` zihan xi
2026-11-16 3:55 ` [PATCH net 2/2] selftests: net: cover connected UDP reuseport rescore Zihan Xi
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=DMWD65CI6NZ6.2V1UCWL1FUM8K@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=benh@amazon.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=vega@nebusec.ai \
--cc=willemdebruijn.kernel@gmail.com \
--cc=zihanx@nebusec.ai \
/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