[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoBT8=w9qHZC+P3nV5F2p7q4-r--aDFSn-TnQLMLkavLwg@mail.gmail.com>
Date: Thu, 4 Sep 2025 14:49:07 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Kuniyuki Iwashima <kuniyu@...gle.com>, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Neal Cardwell <ncardwell@...gle.com>, Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH net-next 1/3] tcp: fix __tcp_close() to only send RST when required
On Thu, Sep 4, 2025 at 2:44 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Wed, Sep 3, 2025 at 11:19 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> >
> > On Thu, Sep 4, 2025 at 1:32 PM Kuniyuki Iwashima <kuniyu@...gle.com> wrote:
> > >
> > > On Wed, Sep 3, 2025 at 10:04 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> > > >
> > > > On Wed, Sep 3, 2025 at 4:47 PM Eric Dumazet <edumazet@...gle.com> wrote:
> > > > >
> > > > > If the receive queue contains payload that was already
> > > > > received, __tcp_close() can send an unexpected RST.
> > > > >
> > > > > Refine the code to take tp->copied_seq into account,
> > > > > as we already do in tcp recvmsg().
> > > > >
> > > > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > > >
> > > > Sorry, Eric. I might be wrong, and I don't think it's a bugfix for now.
> > > >
> > > > IIUC, it's not possible that one skb stays in the receive queue and
> > > > all of the data has been consumed in tcp_recvmsg() unless it's
> > > > MSG_PEEK mode. So my understanding is that the patch tries to cover
> > > > the case where partial data of skb is read by applications and the
> > > > whole skb has not been unlinked from the receive queue yet. Sure, as
> > > > we can learn from tcp_sendsmg(), skb can be partially read.
> > >
> > > You can find a clear example in patch 2 that this patch fixes.
> >
> > Oh, great, a very interesting corner case: resending data with FIN....
>
> Linux TCP stack under memory pressure can do that BTW, no need for
> another implementation :)
>
> tcp_send_fin()
Thank you, Eric!
Powered by blists - more mailing lists