From: netdev-bot+sashiko@kernel.org
To: bugs@stellman-greene.com
Cc: sgarzare@redhat.com, stefanha@redhat.com, bobbyeshleman@meta.com,
mst@redhat.com, jasowangio@gmail.com, eperezma@redhat.com,
xuanzhuo@linux.alibaba.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
willemb@google.com, horms@kernel.org,
virtualization@lists.linux.dev, kvm@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] vsock: wait for EOM before reporting SEQPACKET readable
Date: Fri, 04 Dec 2026 19:13:50 +0000 [thread overview]
Message-ID: <179641163064.3146.10029233264816252719@kernel.org> (raw)
In-Reply-To: <20261203184926.10262-1-bugs@stellman-greene.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The patch suppresses data-ready callbacks for pre-EOM SEQPACKET
fragments, and this breaks vsock SOCK_SEQPACKET sockets that sit in a…
--
vsock: wait for EOM before reporting SEQPACKET readable
For SOCK_SEQPACKET sockets, this patch changes
virtio_transport_notify_poll_in() and vsock_data_ready() to look for a
complete message (msg_count != 0) rather than the number of queued
bytes. Poll no longer reports the socket readable, and data-ready
wakeups no longer fire, before the EOM packet has arrived.
SO_RCVLOWAT no longer affects SEQPACKET poll or wakeups.
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 1d7d53542724f..d403d3226ef8b 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -1117,9 +1117,10 @@ EXPORT_SYMBOL_GPL(vsock_stream_has_space);
>
> void vsock_data_ready(struct sock *sk)
> {
> + int target = sk->sk_type == SOCK_SEQPACKET ? 1 : sk->sk_rcvlowat;
> struct vsock_sock *vsk = vsock_sk(sk);
>
> - if (vsock_stream_has_data(vsk) >= sk->sk_rcvlowat ||
> + if (vsock_connectible_has_data(vsk) >= target ||
> sock_flag(sk, SOCK_DONE))
> sk->sk_data_ready(sk);
> }
[Severity: High]
Can this stall a SOCK_SEQPACKET vsock socket that is in a BPF sockmap
with a verdict program?
sock_map_sk_state_allowed() accepts established vsock SEQPACKET
sockets. When a verdict program is attached, sk_psock_start_verdict()
sets sk->sk_data_ready to sk_psock_verdict_data_ready(). That function
calls read_skb() once per callback and does not loop:
net/core/skmsg.c:sk_psock_verdict_data_ready() {
...
copied = ops->read_skb(sk, sk_psock_verdict_recv);
...
}
For virtio, read_skb() ends up in virtio_transport_read_skb(), which
dequeues a single skb and decrements msg_count only when that skb
carries EOM:
net/vmw_vsock/virtio_transport_common.c:virtio_transport_read_skb() {
...
skb = __skb_recv_datagram(sk, &vvs->rx_queue, MSG_DONTWAIT, &off, &err);
...
if (le32_to_cpu(hdr->flags) & VIRTIO_VSOCK_SEQ_EOM)
vvs->msg_count--;
...
}
Before this patch, virtio_transport_recv_connected() called
vsock_data_ready() for every enqueued packet. With the default
sk_rcvlowat of 1, each of those calls produced a callback.
A message can arrive as several skbs, F1..Fn-1 without EOM and Fn
with EOM. vhost_transport_do_send_pkt() splits host-to-guest packets
to the guest RX buffer size and keeps EOM only on the last piece. The
receive side merges only small payloads into the previous skb. With
the new gate:
F1..Fn-1 enqueued, msg_count == 0 -> no sk_data_ready()
Fn enqueued, msg_count == 1 -> one sk_data_ready()
sk_psock_verdict_data_ready()
vsock_read_skb()
virtio_transport_read_skb() -> dequeues F1 only
msg_count stays 1
F2..Fn then stay in vvs->rx_queue until another packet arrives or
SOCK_DONE is set. Each later callback drains only one more skb, so the
verdict and redirect path falls further behind with every
multi-fragment message. Wouldn't a request/response or proxy setup
hang here, since the rest of the message is never handed to the
verdict program?
The commit message says only that SO_RCVLOWAT no longer affects
SEQPACKET data-ready wakeups. It doesn't mention that pre-EOM
fragments no longer get a callback, or how that affects psock
consumers. Should the sockmap case be handled here, either by keeping
a per-skb callback when a psock is attached or by draining up to the
EOM in the read_skb path?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203184926.10262-1-bugs%40stellman-greene.com
prev parent reply other threads:[~2026-12-04 19:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 18:49 [PATCH net v2] vsock: wait for EOM before reporting SEQPACKET readable Andrew Stellman
2026-12-04 16:12 ` Bobby Eshleman
2026-12-04 18:52 ` sashiko-bot
2026-12-04 19:13 ` netdev-bot+sashiko [this message]
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=179641163064.3146.10029233264816252719@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=bobbyeshleman@meta.com \
--cc=bugs@stellman-greene.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eperezma@redhat.com \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=willemb@google.com \
--cc=xuanzhuo@linux.alibaba.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