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+tcoAr7RHhaZGV12wYDcPPPaubAqdxMCmy7Jujtr8b3+bY=w@mail.gmail.com>
Date: Mon, 21 Oct 2024 10:37:28 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, 
	pabeni@...hat.com, dsahern@...nel.org, ncardwell@...gle.com
Cc: netdev@...r.kernel.org, Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next 2/2] tcp: add more warn of socket in tcp_send_loss_probe()

On Sun, Oct 20, 2024 at 10:50 PM Jason Xing <kerneljasonxing@...il.com> wrote:
>
> From: Jason Xing <kernelxing@...cent.com>
>
> Add two fields to print in the helper which here covers tcp_send_loss_probe().
>
> Link: https://lore.kernel.org/all/5632e043-bdba-4d75-bc7e-bf58014492fd@redhat.com/
> Suggested-by: Paolo Abeni <pabeni@...hat.com>
> Signed-off-by: Jason Xing <kernelxing@...cent.com>
> Cc: Neal Cardwell <ncardwell@...gle.com>
> ---
>  include/net/tcp.h     | 5 ++++-
>  net/ipv4/tcp_output.c | 4 +---
>  2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index cac7bbff61ce..68eb03758950 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -2434,14 +2434,17 @@ static inline void tcp_warn_once(const struct sock *sk, bool cond, const char *s
>  {
>         WARN_ONCE(cond,
>                   "%s"
> +                 "cwnd:%u "
>                   "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",
> +                 "mss:%u advmss:%u mss_cache:%u pmtu:%u\n",
>                   str,
> +                 tcp_snd_cwnd(tcp_sk(sk)),
>                   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_current_mss((struct sock *)sk),
>                   tcp_sk(sk)->advmss, tcp_sk(sk)->mss_cache,
>                   inet_csk(sk)->icsk_pmtu_cookie);
>  }
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 054244ce5117..295bc0741772 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -2954,9 +2954,7 @@ void tcp_send_loss_probe(struct sock *sk)
>         }
>         skb = skb_rb_last(&sk->tcp_rtx_queue);
>         if (unlikely(!skb)) {
> -               WARN_ONCE(tp->packets_out,
> -                         "invalid inflight: %u state %u cwnd %u mss %d\n",
> -                         tp->packets_out, sk->sk_state, tcp_snd_cwnd(tp), mss);
> +               tcp_warn_once(sk, tp->packets_out, NULL);

Sorry, I noticed the warning:
In function ‘tcp_warn_once’,
    inlined from ‘tcp_send_loss_probe’ at ../net/ipv4/tcp_output.c:2957:3:
../include/net/tcp.h:2436:19: warning: ‘%s’ directive argument is null
[-Wformat-overflow=]
 2436 |                   "%s"
      |                   ^~~~

I think It should be:
tcp_warn_once(sk, tp->packets_out, "");

Will handle this soon.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ