public inbox for quic@lists.linux.dev 
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: Simon Horman <horms@kernel.org>
Cc: steved@redhat.com, marcelo.leitner@gmail.com,
	aahringo@redhat.com,  alibuda@linux.alibaba.com,
	jbaron@akamai.com, hare@suse.de, kuba@kernel.org,
	 tom@talpey.com, linux-cifs@vger.kernel.org, daniel@haxx.se,
	 quic@lists.linux.dev, jlayton@kernel.org, tfanelli@redhat.com,
	 dhowells@redhat.com, linkinjeon@kernel.org,
	hepengtao@xiaomi.com,  pc@manguebit.com,
	kernel-tls-handshake@lists.linux.dev,  illiliti@protonmail.com,
	xiyou.wangcong@gmail.com,  andrew.gospodarek@broadcom.com,
	mail@johnericson.me, edumazet@google.com,  pabeni@redhat.com,
	matttbe@kernel.org, netdev@vger.kernel.org,  smfrench@gmail.com,
	metze@samba.org, mbuhl@openbsd.org,  chuck.lever@oracle.com,
	dreibh@simula.no, davem@davemloft.net,  sd@queasysnail.net
Subject: Re: [net-next,v9,06/15] quic: add stream management
Date: Thu, 5 Feb 2026 13:56:01 -0500	[thread overview]
Message-ID: <CADvbK_fsXE6MkgF9KMVThTgsid9Tgkyjrvwyek9NM1jd0KZ4Vg@mail.gmail.com> (raw)
In-Reply-To: <20260205115518.2195328-1-horms@kernel.org>

On Thu, Feb 5, 2026 at 6:55 AM Simon Horman <horms@kernel.org> wrote:
>
> This is an AI-generated review of your patch. The human sending this
> email has considered the AI review valid, or at least plausible.
>
> For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
> ---
> quic: add stream management
>
> This patch introduces stream management infrastructure for the QUIC
> protocol, including a hash table for tracking active streams, functions
> for acquiring and releasing streams, and logic for detecting stream
> ID limits.
>
> > diff --git a/net/quic/socket.c b/net/quic/socket.c
> > index b86989080184..d6f25669c693 100644
> > --- a/net/quic/socket.c
> > +++ b/net/quic/socket.c
> > @@ -41,6 +41,9 @@ static int quic_init_sock(struct sock *sk)
> >       sk->sk_write_space = quic_write_space;
> >       sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
> >
> > +     if (quic_stream_init(quic_streams(sk)))
> > +             return -ENOMEM;
>
> If quic_stream_init() fails here, the function returns before calling
> sk_sockets_allocated_inc() and sock_prot_inuse_add() below. However,
> when initialization fails, inet_create() calls sk_common_release() which
> invokes quic_destroy_sock():
>
> quic_init_sock()
>     quic_stream_init() fails
>     return -ENOMEM
>         -> sk_common_release()
>             -> quic_destroy_sock()
>                 -> sk_sockets_allocated_dec()  // underflow
>                 -> sock_prot_inuse_add(..., -1)  // underflow
>
> Can this cause counter underflow since the increments never executed but
> the decrements in quic_destroy_sock() are unconditional?
This is a good catch, will fix it.

Thanks.
>
> > +
> >       WRITE_ONCE(sk->sk_sndbuf, READ_ONCE(sysctl_quic_wmem[1]));
> >       WRITE_ONCE(sk->sk_rcvbuf, READ_ONCE(sysctl_quic_rmem[1]));
> >
> > @@ -52,6 +55,8 @@ static int quic_init_sock(struct sock *sk)
> >
> >  static void quic_destroy_sock(struct sock *sk)
> >  {
> > +     quic_stream_free(quic_streams(sk));
> > +
> >       quic_data_free(quic_ticket(sk));
>
> [ ... ]

  reply	other threads:[~2026-02-05 18:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 14:27 [PATCH net-next v9 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 01/15] net: define IPPROTO_QUIC and SOL_QUIC constants Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 02/15] net: build socket infrastructure for QUIC protocol Xin Long
2026-02-05 11:54   ` [net-next,v9,02/15] " Simon Horman
2026-02-05 12:48     ` Paolo Abeni
2026-02-05 19:03       ` Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 03/15] quic: provide common utilities and data structures Xin Long
2026-02-05 11:54   ` [net-next,v9,03/15] " Simon Horman
2026-02-05 12:51     ` Paolo Abeni
2026-02-05 19:18       ` Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 04/15] quic: provide family ops for address and protocol Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 05/15] quic: provide quic.h header files for kernel and userspace Xin Long
2026-02-05 11:55   ` [net-next,v9,05/15] " Simon Horman
2026-02-05 19:37     ` Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 06/15] quic: add stream management Xin Long
2026-02-05 11:55   ` [net-next,v9,06/15] " Simon Horman
2026-02-05 18:56     ` Xin Long [this message]
2026-02-02 14:27 ` [PATCH net-next v9 07/15] quic: add connection id management Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 08/15] quic: add path management Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 09/15] quic: add congestion control Xin Long
2026-02-05 11:55   ` [net-next,v9,09/15] " Simon Horman
2026-02-05 19:00     ` Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 10/15] quic: add packet number space Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 11/15] quic: add crypto key derivation and installation Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 12/15] quic: add crypto packet encryption and decryption Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 13/15] quic: add timer management Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 14/15] quic: add packet builder base Xin Long
2026-02-02 14:27 ` [PATCH net-next v9 15/15] quic: add packet parser base Xin Long
2026-02-05 11:55   ` [net-next,v9,15/15] " Simon Horman
2026-02-05 19:02     ` Xin Long

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=CADvbK_fsXE6MkgF9KMVThTgsid9Tgkyjrvwyek9NM1jd0KZ4Vg@mail.gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=aahringo@redhat.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=chuck.lever@oracle.com \
    --cc=daniel@haxx.se \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dreibh@simula.no \
    --cc=edumazet@google.com \
    --cc=hare@suse.de \
    --cc=hepengtao@xiaomi.com \
    --cc=horms@kernel.org \
    --cc=illiliti@protonmail.com \
    --cc=jbaron@akamai.com \
    --cc=jlayton@kernel.org \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=mail@johnericson.me \
    --cc=marcelo.leitner@gmail.com \
    --cc=matttbe@kernel.org \
    --cc=mbuhl@openbsd.org \
    --cc=metze@samba.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pc@manguebit.com \
    --cc=quic@lists.linux.dev \
    --cc=sd@queasysnail.net \
    --cc=smfrench@gmail.com \
    --cc=steved@redhat.com \
    --cc=tfanelli@redhat.com \
    --cc=tom@talpey.com \
    --cc=xiyou.wangcong@gmail.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