netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: Miguel Ojeda <ojeda@kernel.org>,
	edumazet@google.com, davem@davemloft.net, eric.dumazet@gmail.com,
	jmaxwell37@gmail.com, kuba@kernel.org, kuniyu@amazon.com,
	ncardwell@google.com, netdev@vger.kernel.org, pabeni@redhat.com
Subject: Re: [PATCH stable-5.4 4/4] tcp: avoid too many retransmit packets
Date: Tue, 16 Jul 2024 15:03:12 +0200	[thread overview]
Message-ID: <2024071610-cascade-recall-ef1f@gregkh> (raw)
In-Reply-To: <2024071610-rebalance-deserve-ca41@gregkh>

On Tue, Jul 16, 2024 at 02:56:28PM +0200, Greg KH wrote:
> On Tue, Jul 16, 2024 at 02:53:12PM +0200, Greg KH wrote:
> > On Tue, Jul 16, 2024 at 08:40:40PM +0800, Jason Xing wrote:
> > > On Tue, Jul 16, 2024 at 7:10 PM Miguel Ojeda <ojeda@kernel.org> wrote:
> > > >
> > > > Hi Greg, Eric, all,
> > > >
> > > > I noticed this in stable-rc/queue and stable-rc/linux- for 6.1 and 6.6:
> > > >
> > > >     net/ipv4/tcp_timer.c:472:7: error: variable 'rtx_delta' is uninitialized when used here [-Werror,-Wuninitialized]
> > > >                     if (rtx_delta > user_timeout)
> > > >                         ^~~~~~~~~
> > > >     net/ipv4/tcp_timer.c:464:15: note: initialize the variable 'rtx_delta' to silence this warning
> > > >             u32 rtx_delta;
> > > >                         ^
> > > >                         = 0
> > > >
> > > > I hope that helps!
> > > 
> > > Thanks for the report!
> > > 
> > > I think it missed one small snippet of code from [1] compared to the
> > > latest kernel. We can init this part before using it, something like
> > > this:
> > > 
> > > +       rtx_delta = (u32)msecs_to_jiffies(tcp_time_stamp(tp) -
> > > +                       (tp->retrans_stamp ?: tcp_skb_timestamp(skb)));
> > > 
> > > Note: fully untested.
> > > 
> > > Since Eric is very busy, I decided to check and provide some useful
> > > information here.
> > 
> > Thanks all, this was probably due to my manual backporting here, let me
> > go check what went wrong...
> 
> Yeah, this is my fault, due to 614e8316aa4c ("tcp: add support for usec
> resolution in TCP TS values") not being in the tree, let me go rework
> things...

Ok, backporting that commit is not going to happen, that's crazy...

Anyway, the diff below is what I made on top of the existing one, which
should be doing the right thing.  But ideally someone can test this,
somehow...  I'll push out -rc releases later today so that people can
pound on it easier.

thanks for the review!

greg k-h


--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -464,6 +464,9 @@ static bool tcp_rtx_probe0_timed_out(con
 	u32 rtx_delta;
 	s32 rcv_delta;
 
+	rtx_delta = (u32)msecs_to_jiffies(tcp_time_stamp(tp) -
+			(tp->retrans_stamp ?: tcp_skb_timestamp(skb)));
+
 	if (user_timeout) {
 		/* If user application specified a TCP_USER_TIMEOUT,
 		 * it does not want win 0 packets to 'reset the timer'
@@ -482,9 +485,6 @@ static bool tcp_rtx_probe0_timed_out(con
 	if (rcv_delta <= timeout)
 		return false;
 
-	rtx_delta = (u32)msecs_to_jiffies(tcp_time_stamp(tp) -
-			(tp->retrans_stamp ?: tcp_skb_timestamp(skb)));
-
 	return rtx_delta > timeout;
 }
 

  reply	other threads:[~2024-07-16 13:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16  1:53 [PATCH stable-5.4 0/4] tcp: stable backports for CVE-2024-41007 Eric Dumazet
2024-07-16  1:53 ` [PATCH stable-5.4 1/4] tcp: refactor tcp_retransmit_timer() Eric Dumazet
2024-07-16  1:53 ` [PATCH stable-5.4 2/4] net: tcp: fix unexcepted socket die when snd_wnd is 0 Eric Dumazet
2024-07-16  1:53 ` [PATCH stable-5.4 3/4] tcp: use signed arithmetic in tcp_rtx_probe0_timed_out() Eric Dumazet
2024-07-16  1:54 ` [PATCH stable-5.4 4/4] tcp: avoid too many retransmit packets Eric Dumazet
2024-07-16 11:10   ` Miguel Ojeda
2024-07-16 12:40     ` Jason Xing
2024-07-16 12:53       ` Greg KH
2024-07-16 12:56         ` Greg KH
2024-07-16 13:03           ` Greg KH [this message]
2024-07-16 14:21             ` Eric Dumazet

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=2024071610-cascade-recall-ef1f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jmaxwell37@gmail.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=pabeni@redhat.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).