All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@google.com>
To: lucien.xin@gmail.com
Cc: aahringo@redhat.com, alibuda@linux.alibaba.com,
	 andrew.gospodarek@broadcom.com, chuck.lever@oracle.com,
	daniel@haxx.se,  davem@davemloft.net, dhowells@redhat.com,
	dreibh@simula.no,  edumazet@google.com, hare@suse.de,
	hepengtao@xiaomi.com, horms@kernel.org,  illiliti@protonmail.com,
	jbaron@akamai.com, jlayton@kernel.org,
	 kernel-tls-handshake@lists.linux.dev, kuba@kernel.org,
	linkinjeon@kernel.org,  linux-cifs@vger.kernel.org,
	mail@johnericson.me, marcelo.leitner@gmail.com,
	 matttbe@kernel.org, mbuhl@openbsd.org,
	mef@scarletmail.rutgers.edu,  metze@samba.org,
	netdev-bot+sashiko@kernel.org, netdev@vger.kernel.org,
	 pabeni@redhat.com, paul@jakma.org, pc@manguebit.org,
	quic@lists.linux.dev,  sd@queasysnail.net, steved@redhat.com,
	tfanelli@redhat.com, tom@talpey.com,  xiyou.wangcong@gmail.com
Subject: Re: [PATCH net-next v15 15/15] quic: add packet parser base
Date: Wed, 16 Sep 2026 23:46:13 +0000	[thread overview]
Message-ID: <20260916234654.420056-1-kuniyu@google.com> (raw)
In-Reply-To: <CADvbK_dHPkHjkPwu0RepYgDsHs5reHepprRHU9hDFBxQM9_RGw@mail.gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Wed, 16 Sep 2026 14:08:22 -0400
> > > +struct sock *quic_listen_sock_lookup(struct sk_buff *skb, union quic_addr *sa,
> > > +                                  union quic_addr *da, struct sock *usk,
> > > +                                  struct quic_data *alpns)
> > > +{
> >
> > [ ... ]
> >
> > > +out:
> > > +     if (sk && sk->sk_reuseport)
> > > +             sk = reuseport_select_sock(sk, quic_addr_hash(net, da), skb, 1);
> >
> > [Severity: Medium]
> > Should the hdr_len argument be 0 rather than 1 here?
> >
> > quic_udp_rcv() already did skb_pull(skb, sizeof(struct udphdr)) before
> > quic_packet_rcv() is reached, so skb->data points at the QUIC payload, and
> > reuseport_select_sock() documents hdr_len as how far the pointer must advance
> > to reach the payload.
> >
> > With a classic SO_ATTACH_REUSEPORT_CBPF program, run_bpf_filter() does:
> >
> > net/core/sock_reuseport.c:
> >         if (unlikely(!pskb_may_pull(skb, hdr_len)))
> >                 return -EINVAL;
> >         ...
> >         pskb_pull(skb, hdr_len);
> >         ...
> >         __skb_push(skb, hdr_len);
> >
> > so the filter would see the datagram starting one byte into the QUIC header:
> > all its offsets are shifted and the first byte (form/fixed/type bits) is
> > invisible, which can select the wrong socket in the reuseport group.
> >
> > [ ... ]
> >
> True:
> 
> BPF programs may need to access the QUIC header, so I will pass 0 to
> reuseport_select_sock() to ensure the full QUIC packet is visible.

Why do you use reuseport_select_sock() here ?

  reply	other threads:[~2026-09-16 23:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 13:49 [PATCH net-next v15 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 01/15] net: define IPPROTO_QUIC and SOL_QUIC constants Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 02/15] net: build socket infrastructure for QUIC protocol Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 03/15] quic: provide common utilities and data structures Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 15:18     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 04/15] quic: provide family ops for address and protocol Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 05/15] quic: provide quic.h header files for kernel and userspace Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 06/15] quic: add stream management Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 15:21     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 07/15] quic: add connection id management Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 08/15] quic: add path management Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 15:43     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 09/15] quic: add congestion control Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 15:48     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 10/15] quic: add packet number space Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 11/15] quic: add crypto key derivation and installation Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 15:51     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 12/15] quic: add crypto packet encryption and decryption Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 16:01     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 13/15] quic: add timer management Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 14/15] quic: add packet builder base Xin Long
2026-09-15 19:50   ` netdev-bot+sashiko
2026-09-16 16:20     ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 15/15] quic: add packet parser base Xin Long
2026-09-15 19:51   ` netdev-bot+sashiko
2026-09-15 21:34     ` Xin Long
2026-09-16 18:08     ` Xin Long
2026-09-16 23:46       ` Kuniyuki Iwashima [this message]
2026-09-17 13:38         ` Xin Long
2026-09-17 19:06           ` Kuniyuki Iwashima
2026-09-18 19:51             ` Xin Long
2026-09-16 18:33 ` [PATCH net-next v15 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-09-17  8:35   ` Paolo Abeni
2026-09-18 19:59     ` 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=20260916234654.420056-1-kuniyu@google.com \
    --to=kuniyu@google.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=lucien.xin@gmail.com \
    --cc=mail@johnericson.me \
    --cc=marcelo.leitner@gmail.com \
    --cc=matttbe@kernel.org \
    --cc=mbuhl@openbsd.org \
    --cc=mef@scarletmail.rutgers.edu \
    --cc=metze@samba.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul@jakma.org \
    --cc=pc@manguebit.org \
    --cc=quic@lists.linux.dev \
    --cc=sd@queasysnail.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.