From: David Gibson <david@gibson.dropbear.id.au>
To: Eric Dumazet <edumazet@google.com>
Cc: Stefano Brivio <sbrivio@redhat.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
netdev@vger.kernel.org, Kuniyuki Iwashima <kuniyu@amazon.com>,
Mike Manning <mvrmanning@gmail.com>,
Paul Holzinger <pholzing@redhat.com>,
Philo Lu <lulie@linux.alibaba.com>,
Cambda Zhu <cambda@linux.alibaba.com>,
Fred Chen <fred.cc@alibaba-inc.com>,
Yubing Qiu <yubing.qiuyubing@alibaba-inc.com>
Subject: Re: [PATCH net-next 2/2] datagram, udp: Set local address and rehash socket atomically against lookup
Date: Fri, 6 Dec 2024 09:32:20 +1100 [thread overview]
Message-ID: <Z1Ip9Ij8_JpoFu8c@zatzit> (raw)
In-Reply-To: <CANn89i+iULeqTO2GrTCDZEOKPmU_18zwRxG6-P1XoqhP_j1p3A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]
On Thu, Dec 05, 2024 at 05:35:52PM +0100, Eric Dumazet wrote:
> On Wed, Dec 4, 2024 at 11:12 PM Stefano Brivio <sbrivio@redhat.com> wrote:
[snip]
> > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> > index 6a01905d379f..8490408f6009 100644
> > --- a/net/ipv4/udp.c
> > +++ b/net/ipv4/udp.c
> > @@ -639,18 +639,21 @@ struct sock *__udp4_lib_lookup(const struct net *net, __be32 saddr,
> > int sdif, struct udp_table *udptable, struct sk_buff *skb)
> > {
> > unsigned short hnum = ntohs(dport);
> > - struct udp_hslot *hslot2;
> > + struct udp_hslot *hslot, *hslot2;
> > struct sock *result, *sk;
> > unsigned int hash2;
> >
> > + hslot = udp_hashslot(udptable, net, hnum);
> > + spin_lock_bh(&hslot->lock);
>
> This is not acceptable.
> UDP is best effort, packets can be dropped.
> Please fix user application expectations.
The packets aren't merely dropped, they're rejected with an ICMP Port
Unreachable.
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-12-05 22:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 22:12 [PATCH net-next 0/2] Fix race between datagram socket address change and rehash Stefano Brivio
2024-12-04 22:12 ` [PATCH net-next 1/2] datagram: Rehash sockets only if local address changed for their family Stefano Brivio
2024-12-04 22:12 ` [PATCH net-next 2/2] datagram, udp: Set local address and rehash socket atomically against lookup Stefano Brivio
2024-12-05 9:30 ` Paolo Abeni
2024-12-05 15:58 ` Stefano Brivio
2024-12-05 16:53 ` Paolo Abeni
2024-12-06 10:50 ` Stefano Brivio
2024-12-06 12:36 ` Paolo Abeni
2024-12-06 13:35 ` Stefano Brivio
2024-12-06 15:10 ` Paolo Abeni
2024-12-18 16:21 ` Stefano Brivio
2024-12-05 16:35 ` Eric Dumazet
2024-12-05 22:32 ` David Gibson [this message]
2024-12-05 22:52 ` Eric Dumazet
2024-12-06 2:16 ` David Gibson
2024-12-06 9:04 ` Eric Dumazet
2024-12-09 2:20 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2024-12-10 18:34 kernel test robot
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=Z1Ip9Ij8_JpoFu8c@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=cambda@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=fred.cc@alibaba-inc.com \
--cc=kuniyu@amazon.com \
--cc=lulie@linux.alibaba.com \
--cc=mvrmanning@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pholzing@redhat.com \
--cc=sbrivio@redhat.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=yubing.qiuyubing@alibaba-inc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.