lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoCMrENefD=55fkGRBAE9ZeuwgB7UG03JggSiguG-QVZiw@mail.gmail.com>
Date: Tue, 24 Sep 2024 08:37:18 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Neal Cardwell <ncardwell@...gle.com>
Cc: Paolo Abeni <pabeni@...hat.com>, Josh Hunt <johunt@...mai.com>, edumazet@...gle.com, 
	davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3] tcp: check skb is non-NULL in tcp_rto_delta_us()

On Fri, Sep 20, 2024 at 1:36 AM Neal Cardwell <ncardwell@...gle.com> wrote:
>
> On Thu, Sep 19, 2024 at 5:05 AM Paolo Abeni <pabeni@...hat.com> wrote:
> >
> > On 9/10/24 21:08, Josh Hunt wrote:
> > > diff --git a/include/net/tcp.h b/include/net/tcp.h
> > > index 2aac11e7e1cc..196c148fce8a 100644
> > > --- a/include/net/tcp.h
> > > +++ b/include/net/tcp.h
> > > @@ -2434,9 +2434,26 @@ static inline s64 tcp_rto_delta_us(const struct sock *sk)
> > >   {
> > >       const struct sk_buff *skb = tcp_rtx_queue_head(sk);
> > >       u32 rto = inet_csk(sk)->icsk_rto;
> > > -     u64 rto_time_stamp_us = tcp_skb_timestamp_us(skb) + jiffies_to_usecs(rto);
> > >
> > > -     return rto_time_stamp_us - tcp_sk(sk)->tcp_mstamp;
> > > +     if (likely(skb)) {
> > > +             u64 rto_time_stamp_us = tcp_skb_timestamp_us(skb) + jiffies_to_usecs(rto);
> > > +
> > > +             return rto_time_stamp_us - tcp_sk(sk)->tcp_mstamp;
> > > +     } else {
> > > +             WARN_ONCE(1,
> > > +                     "rtx queue emtpy: "
> > > +                     "out:%u sacked:%u lost:%u retrans:%u "
> > > +                     "tlp_high_seq:%u sk_state:%u ca_state:%u "
> > > +                     "advmss:%u mss_cache:%u pmtu:%u\n",
> > > +                     tcp_sk(sk)->packets_out, tcp_sk(sk)->sacked_out,
> > > +                     tcp_sk(sk)->lost_out, tcp_sk(sk)->retrans_out,
> > > +                     tcp_sk(sk)->tlp_high_seq, sk->sk_state,
> > > +                     inet_csk(sk)->icsk_ca_state,
> > > +                     tcp_sk(sk)->advmss, tcp_sk(sk)->mss_cache,
> > > +                     inet_csk(sk)->icsk_pmtu_cookie);
> >
> > As the underlying issue here share the same root cause as the one
> > covered by the WARN_ONCE() in tcp_send_loss_probe(), I'm wondering if it
> > would make sense do move the info dumping in a common helper, so that we
> > get the verbose warning on either cases.
>
> That's a good idea. It would be nice to move the info dumping into a
> common helper and use it from both tcp_rto_delta_us() and
> tcp_send_loss_probe(), if Josh is open to that.

Hello Paolo, Neal,

I noticed that this patch got merged already. Since extracting the
common part into a helper belongs to net-next materials, if no one is
willing to do it after net-next is re-opened, I think I can post it :)

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ