From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796411632; b=eUW7r1BgnzGFSsKoXP1tVF4cxJNS0KMzZRA+awI7/47E8TJU+9nF7Ac9VimDnF+2gVX+ fkcQmzBkpPmjU6VjFw7fPkN3oT2wlsyYQunUpiT9bqKeSiboh9VsPG9ncFF4C0SJHiyuM wtbgWo/lGCD8c2IWuYv0ckcD5kyRCvWFz9/S620/qs6oTmN1O014QKDmSQKHR+6sDVfM5 WWVy5kH7eHkH2ReA94+m6jP5D7spAgWb4i4ImlT9zoy4oJ9h+itJbG4RQZ4ErkIjt5Kpv 6cRAKOVXvGyfmtkrsBrsBKXkKHLi9PmUok32uDe74+10r7KdcQ1JZGL0Jv1mgeb7nDg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796411632; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=iSIDm6rBaVlm49ELF5MwGs5t+Jx1KLn9gN1UMXktdYE=; b=HpFmUG7JhCT6WUoQ0T3WL/9SgM39yAnn9LqLPrW8qg72DrymBgPK2JI/94XOQgy/jGNb Z8a2WAmLwIUrvJHGn9VSjdN8LAMGa0GrRpL31cpEdbAYS3CWe6XjlJowmdRHT4ATbKPGt apOHQE/wDA70Nfm5WbzQlS44vC1yvOVXi6dSYJx+yJUcZxA2B5jGQZhmK0visCI4WhXBm VU7q8YRkx/EbF9YWMFQ182goN4cIOL101+MdjRSp0bCQfmbUMvMlJpSgcY6unJh7SK9ng A0cosvNpryjVOxCOIPDMCowlGNaHXTjqmUGwWON5/SBYqD7SIdIribq29+jiI4B9JCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L8Dn18ZE; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90295606A322; Fri, 4 Dec 2026 19:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L8Dn18ZE Received: by smtp.kernel.org (Postfix) with ESMTPSA id 260B91F00936; Fri, 4 Dec 2026 19:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796411632; bh=iSIDm6rBaVlm49ELF5MwGs5t+Jx1KLn9gN1UMXktdYE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=L8Dn18ZExi5dlZik2yXteomJZohBkMJIoASY3Y9wbb01yWNzlCn/niTQfuxrAqrCz DZ02Xt7fxNRK0BEYiWuhzydEgFtxWnyVnQYNNwJ+L1uyfMKY+caEk6PUg9zV2z2i2h z4g3xgKWqcCgj3INbLHFWMTlui2DKTqg3/L5U6ccQBeAso3lHIQZPeKAOgMSXhvt3q efLGtjEDRRUFbFk95rnoCswztgTaRxSZAV3PHkEeWsjR72xBDH8XOAberot7C13Z84 QXOjaJ3KMU8PSbXSSZKrzsaJ+VZI4X4pes/3q8PD3Z8pEyIEAjVxzXQXf+FsDAi3R/ +dVhZEmJ//jSg== Subject: Re: [PATCH net v2] vsock: wait for EOM before reporting SEQPACKET readable 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 Date: Fri, 04 Dec 2026 19:13:50 +0000 Message-ID: <179641163064.3146.10029233264816252719@kernel.org> In-Reply-To: <20261203184926.10262-1-bugs@stellman-greene.com> References: <20261203184926.10262-1-bugs@stellman-greene.com> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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