From nobody Sun Feb 8 04:30:14 2026 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 040332DF68 for ; Wed, 17 Dec 2025 18:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995158; cv=none; b=H8C57ydfZPUvWNSefEuclfuFUzRk0O2eozn+hRYIYAQ/MdwE9vDxtjvXwrQW3Jblr4ybb3rf8VbUb+ItpouB9xCJdHRXN6tMBx+QjFuZjiTn/DItN+WWziF4nIiqiA7QYsLwWoGpM9GVQdF/VOTqu6BMQRDW1nlnIaG+5RbuSps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995158; c=relaxed/simple; bh=Jmqh+IeYEuPfjt31rwC4R8TE4lp1zQaI90wvXPqlmWk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UmeU/kkw3dS2LURm7mn9xs/EYjsZMOIcIQGWAUnaqqkh35J+u9RPnxgRySg6QYhSNozWsMG8OGWusid5QN8oTR+yJuI9c90NlRv1dFFAhHemMMXhLyznfRZmAIuU6f3Hl/IHKKTuKrEqrC9rmalKkBFPfe6eg2AV1InkCcqBcEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mUGTr0S1; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mUGTr0S1" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-598f59996aaso883193e87.1 for ; Wed, 17 Dec 2025 10:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765995150; x=1766599950; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F+qEOT5fYFn8bKw8MykPWrfcTTy8Zhs7SgEc83K5GNw=; b=mUGTr0S1hNDy11oFxzMwD6LIKfLNvr29epV5m9bRtT4p3FFDNHk96OuCvO4caJorqU CwlVDtic3mu7OYvHghSRdxATFA2aPLkp6yH2XG5H4VAnLRW0RPh2pmMB4fB4i+VYBmyc MVSwQIG7oEO8JFc+oT+Aa5ZiGU4rbUubz3zvqT3gscIhbHOEXzMoFj1c2V2wrDzoFzKm 2JeSratQTkZ/bEVzatEiYo330fqsneTSbf0ME9/gLzhXv3iMAf7xI9dQeRQaiTpjx+Gd Jj26DaEmjhBZQsKjJv9z5mLJNrA/ggtruEliL+NZGwpAErA0Hx7u0ZHdp3+z8wwQa8OP FpOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765995150; x=1766599950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=F+qEOT5fYFn8bKw8MykPWrfcTTy8Zhs7SgEc83K5GNw=; b=erj7rOPeA2xB00IfALIW0RYhICkb7rmebdVXOzSxkNhxjjIiOYcHIqGUgaiMLuWrG8 hzbUhgaVutSnVehAxwHwlTBl3mLNXsddzzm/fOoPxagZbt1rIjMeEbXr3NrnkKBQmshn NqID7MBFJsSnTePX8XWvaGNB7JsrngAkaAolCtWlgSm2k1NyqdJkFE759l1++qPpcOew XOEQoV0O1CGV2H5mapaxD+Sy7nRqx7yay+pzhABxfZzuq8qu479sHwBmAgllKmhC3NEn HH9MRtMPrK9Gvb1e4I06kznylo9EFluxy8X6nB0TDZDjnxkLHopJBlUJHil+Tots31jQ eRdg== X-Forwarded-Encrypted: i=1; AJvYcCWeCPh49Z0FnXJePpYze2OV638/QYq5edzhPX7dzXK8ucg53qKSdywTMGoZenHxYR5EWJQWsW8bNrBnGQk=@vger.kernel.org X-Gm-Message-State: AOJu0YxUZZhurFBGXKjkAXo/Sha+esiavDM4iGQ02hz4Nloe4EP47gL/ /De1wyOYn0xijdUQs/OAKEcwU4unU7CxTupSP1GGPYakAoT5D/5EABMD X-Gm-Gg: AY/fxX7bpjzNHwctVZNLTwkSB0W27+94hYEZ8d5Pz1KbXvd+/D0OJ9LkJ4RCZ1g/oRR 4qDB7kUSWKWMdDoy1qj6Iagvb85Uicws9vduap5JOVP+08DPAcU/3pgexF/x1UNOuPnfyDf1SCR YzKsdctgUu2j4O73/mOjDvoWNRQM1uTtbneupgpnpaYqjraKJ6udr775ivm8lM3H4JhL2dwABPp nkAHgQACVot9CH9MgEnTaZhBiYFJWX61WuRqF/+nL4wf15J1UjE4MsHL/0x9sQAUX5nkMO8uVf2 vlInNJqQygO5O3AzCp9YBGHdKy6qjToGsp3vNzfHoSol9H/cSnw9bDwr5nyRMy9+hPXQwPS+SVT c+n/adNgv8NWr2pOaUxmL/qDm0MYq7fgZt7sETBUnVADfQM3IKDaqU30b9XkiRdzCH2SCpN1+qO 5wAnoOErOud0U= X-Google-Smtp-Source: AGHT+IFaImgQ8mUsB8FX9vCVAZe8oyinyLF2HvL8aiazJQVjXwZSAkQ7Y1ZG0/etX5aTcNag1fMWgA== X-Received: by 2002:a05:6512:3e0e:b0:595:840c:cdd0 with SMTP id 2adb3069b0e04-598faa14759mr5788325e87.2.1765995149770; Wed, 17 Dec 2025 10:12:29 -0800 (PST) Received: from Ubuntu-2204-jammy-amd64-base.. ([2a01:4f9:6a:4e9f::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5990da790efsm2591419e87.102.2025.12.17.10.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 10:12:29 -0800 (PST) From: Melbin K Mathew To: stefanha@redhat.com, sgarzare@redhat.com Cc: kvm@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, Melbin K Mathew Subject: [PATCH net v4 1/4] vsock/virtio: fix potential underflow in virtio_transport_get_credit() Date: Wed, 17 Dec 2025 19:12:03 +0100 Message-Id: <20251217181206.3681159-2-mlbnkm1@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251217181206.3681159-1-mlbnkm1@gmail.com> References: <20251217181206.3681159-1-mlbnkm1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The credit calculation in virtio_transport_get_credit() uses unsigned arithmetic: ret =3D vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); If the peer shrinks its advertised buffer (peer_buf_alloc) while bytes are in flight, the subtraction can underflow and produce a large positive value, potentially allowing more data to be queued than the peer can handle. Use s64 arithmetic for the subtraction and clamp negative results to zero, matching the approach already used in virtio_transport_has_space(). Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko") Suggested-by: Stefano Garzarella Signed-off-by: Melbin K Mathew --- net/vmw_vsock/virtio_transport_common.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio= _transport_common.c index dcc8a1d5851e..d692b227912d 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -494,14 +494,25 @@ EXPORT_SYMBOL_GPL(virtio_transport_consume_skb_sent); u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) { u32 ret; + u32 inflight; + s64 bytes; =20 if (!credit) return 0; =20 spin_lock_bh(&vvs->tx_lock); - ret =3D vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); - if (ret > credit) - ret =3D credit; + + /* + * Compute available space using s64 to avoid underflow if + * peer_buf_alloc < inflight bytes (can happen if peer shrinks + * its advertised buffer while data is in flight). + */ + inflight =3D vvs->tx_cnt - vvs->peer_fwd_cnt; + bytes =3D (s64)vvs->peer_buf_alloc - inflight; + if (bytes < 0) + bytes =3D 0; + + ret =3D (bytes > credit) ? credit : (u32)bytes; vvs->tx_cnt +=3D ret; vvs->bytes_unsent +=3D ret; spin_unlock_bh(&vvs->tx_lock); --=20 2.34.1 From nobody Sun Feb 8 04:30:14 2026 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DF8B2773F0 for ; Wed, 17 Dec 2025 18:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995159; cv=none; b=pubY5nJ3cl6aLj+H4HjBosMpVCTnKv+ErkqmQTEqM4IZi91qWL3n1psfcIzCIg3g0t3Hey7HaJbHRsc2Fq2CCXDwnrBxSUNNuEbPyYnDOSVR5sKb0q/F4WxHJol0PngflOqBhXyWcZPE61DKWxPRMze9JSTyYtNMlAo8sm87k9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995159; c=relaxed/simple; bh=+q4OPt2stNgoEY1wZPAOuLkUrNjM0zDoFE6c77HSEmU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TGuGW7gn6xmIagsP3Ut7BQ6WGspFrZ9H4aHZ1+D6CVwr+PTEVlpLfjYLK0j2GG86RPzOcWtcKPbVeYIgXHAL4mUDADxwLhT/4D1PETgpWalwGOObOJ/MNfwon5cQIJUZi+3OA+xI7+fuvG3JPtMHBoBsVolgGDV71aKcSaSoOaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XnTyEwHI; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XnTyEwHI" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-59a10df8027so793211e87.0 for ; Wed, 17 Dec 2025 10:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765995152; x=1766599952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C6L/g6AKDLzO2oXAkjTlOO45wco9Gy2vbAOvP3aPl+o=; b=XnTyEwHIIEqjaz4eoNNWFhuIVDNC7jYrsKnczJ8o7QN33hJJWzZ9t6YwHEteGxvbPz C7QTwxwJd1hSe2oonJGQiY5uXVU20XMd9XfKiPiKudBPGoTbWL34cx0TeazEelbSC0sM hJJga/C6+m4DS3DB95HBTe98LjDiFhJk2oQR6whiOGGDpQsfntXckxqnV5MA55RO2AxB BxHcUcSHqmQU6/g8Fga67iObhFm4sR8v7sADrJPjh4Je/ZPX67a1SL+kWe0A/8MAoBuN zLoONQAvJai7Q4RnZIDldV0YJTGFSvrmk5rSYQtWHbSx5xqUkVT0LgXBvoObtmC/HwGT PAEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765995152; x=1766599952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C6L/g6AKDLzO2oXAkjTlOO45wco9Gy2vbAOvP3aPl+o=; b=EphZ09mx9O2HCJaRzlMymKyuVGrU7kECqigmHUZhZWTM/DK8qI/5XvFAyHTw3GqddY BK2nuVTtPkH1MFPMI5VfyWFA8Qc+rj7oSS5z1XSjHrpjUGro7j91AoHJSsIDXR92Yooj D0joHc1DbG8OwiNFQa1w9+4iY6KBiA8SO2+bw0lrOWF3pY5qU68Z/DxnSD4O5tK/Qq7a bo1qzXkeMLC71uzsInpvkGx8wquwOUI7vFVq6OGw4LPbEYdXhhiAunprndj1Yiw9HMP9 bk+xBwIU4RMZqLmBYamRluFnvHI6Lqze2FY087E+Xa91QS/l2iNJm++ukKKcK4dL5tAY gYDQ== X-Forwarded-Encrypted: i=1; AJvYcCUo3rHvx2JXn2TbPYhocQmqoXIuh10EQWgsam5f8MIdtpA42K+dHcPt7gaq45QELe+QmnZhq25/da0TSvo=@vger.kernel.org X-Gm-Message-State: AOJu0YxcPQH05wpflRsNM5Bg3nJ3rAYt+cwBwwmlUWcUkUUDdLUER/aH lFcyx1oNEuFhmsOvc+QjvMtJsk3RY2rjtYyIn1gxDcnWertTQ+AF/td5 X-Gm-Gg: AY/fxX5OObmqTDzp14hnGQ2tDPUUYwRq1tlC81sY9VWEncpZ9+fEF3PdsnTNhMwpMvt nsd00R9SK2rsBrQtc5awQpNrTd26SNUl+xf1h/Lb0NcSYj0qcKJgRA5rQPZSY/OSkTTwz+AlUeS a+kKWWNHwh8XmRr+E+41WIb6gA0zVyLcvgw7pFFV0QxIE0irZcO9/xj9rqqbEMRKlkeecuLOwMw jS2hbxQy1oQuMlLs4sXJ/dzSIwdQu4IxFqE6SVBehBgYd7CPiqm5+Xjb+cFQ2jCQ5bIsidIRSwH 2Ra12zo+YhijsgYWlyI2zcih5pvCXEWgimtWH5teOo1bggCXPGjjsrzysda2sAWAL274JWaOFQc Eo4mgfCBWmkiT9B7QALdxNFyc7RApD2IayeM2w1SHMsVObL/A2K6on56oZIEOCxarHn1aBtVeNY VOQ34JaVJAiNs= X-Google-Smtp-Source: AGHT+IFoJv0VtI+duA1BFZ1b2nyx/9qNil7UNuQ2voy1UQrqjVxXTqBKmiQjS+TdeaY4sOWMw/E4ZA== X-Received: by 2002:a05:6512:3b86:b0:597:d7dc:b7ce with SMTP id 2adb3069b0e04-598faa3bd8amr6715768e87.30.1765995151819; Wed, 17 Dec 2025 10:12:31 -0800 (PST) Received: from Ubuntu-2204-jammy-amd64-base.. ([2a01:4f9:6a:4e9f::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5990da790efsm2591419e87.102.2025.12.17.10.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 10:12:31 -0800 (PST) From: Melbin K Mathew To: stefanha@redhat.com, sgarzare@redhat.com Cc: kvm@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, Melbin K Mathew Subject: [PATCH net v4 2/4] vsock/virtio: cap TX credit to local buffer size Date: Wed, 17 Dec 2025 19:12:04 +0100 Message-Id: <20251217181206.3681159-3-mlbnkm1@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251217181206.3681159-1-mlbnkm1@gmail.com> References: <20251217181206.3681159-1-mlbnkm1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The virtio vsock transport derives its TX credit directly from peer_buf_alloc, which is set from the remote endpoint's SO_VM_SOCKETS_BUFFER_SIZE value. On the host side this means that the amount of data we are willing to queue for a connection is scaled by a guest-chosen buffer size, rather than the host's own vsock configuration. A malicious guest can advertise a large buffer and read slowly, causing the host to allocate a correspondingly large amount of sk_buff memory. Introduce a small helper, virtio_transport_tx_buf_alloc(), that returns min(peer_buf_alloc, buf_alloc), and use it wherever we consume peer_buf_alloc: - virtio_transport_get_credit() - virtio_transport_has_space() - virtio_transport_seqpacket_enqueue() This ensures the effective TX window is bounded by both the peer's advertised buffer and our own buf_alloc (already clamped to buffer_max_size via SO_VM_SOCKETS_BUFFER_MAX_SIZE), so a remote guest cannot force the host to queue more data than allowed by the host's own vsock settings. On an unpatched Ubuntu 22.04 host (~64 GiB RAM), running a PoC with 32 guest vsock connections advertising 2 GiB each and reading slowly drove Slab/SUnreclaim from ~0.5 GiB to ~57 GiB; the system only recovered after killing the QEMU process. With this patch applied: Before: MemFree: ~61.6 GiB Slab: ~142 MiB SUnreclaim: ~117 MiB After 32 high-credit connections: MemFree: ~61.5 GiB Slab: ~178 MiB SUnreclaim: ~152 MiB Only ~35 MiB increase in Slab/SUnreclaim, no host OOM, and the guest remains responsive. Compatibility with non-virtio transports: - VMCI uses the AF_VSOCK buffer knobs to size its queue pairs per socket based on the local vsk->buffer_* values; the remote side cannot enlarge those queues beyond what the local endpoint configured. - Hyper-V's vsock transport uses fixed-size VMBus ring buffers and an MTU bound; there is no peer-controlled credit field comparable to peer_buf_alloc, and the remote endpoint cannot drive in-flight kernel memory above those ring sizes. - The loopback path reuses virtio_transport_common.c, so it naturally follows the same semantics as the virtio transport. This change is limited to virtio_transport_common.c and thus affects virtio and loopback, bringing them in line with the "remote window intersected with local policy" behaviour that VMCI and Hyper-V already effectively have. Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko") Suggested-by: Stefano Garzarella Signed-off-by: Melbin K Mathew --- net/vmw_vsock/virtio_transport_common.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio= _transport_common.c index d692b227912d..92575e9d02cd 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -491,6 +491,18 @@ void virtio_transport_consume_skb_sent(struct sk_buff = *skb, bool consume) } EXPORT_SYMBOL_GPL(virtio_transport_consume_skb_sent); =20 +/* + * Return the effective peer buffer size for TX credit. + * + * The peer advertises its receive buffer via peer_buf_alloc, but we cap + * it to our local buf_alloc so a remote peer cannot force us to queue + * more data than our own buffer configuration allows. + */ +static u32 virtio_transport_tx_buf_alloc(struct virtio_vsock_sock *vvs) +{ + return min(vvs->peer_buf_alloc, vvs->buf_alloc); +} + u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) { u32 ret; @@ -508,7 +520,7 @@ u32 virtio_transport_get_credit(struct virtio_vsock_soc= k *vvs, u32 credit) * its advertised buffer while data is in flight). */ inflight =3D vvs->tx_cnt - vvs->peer_fwd_cnt; - bytes =3D (s64)vvs->peer_buf_alloc - inflight; + bytes =3D (s64)virtio_transport_tx_buf_alloc(vvs) - inflight; if (bytes < 0) bytes =3D 0; =20 @@ -842,7 +854,7 @@ virtio_transport_seqpacket_enqueue(struct vsock_sock *v= sk, =20 spin_lock_bh(&vvs->tx_lock); =20 - if (len > vvs->peer_buf_alloc) { + if (len > virtio_transport_tx_buf_alloc(vvs)) { spin_unlock_bh(&vvs->tx_lock); return -EMSGSIZE; } @@ -893,7 +905,7 @@ static s64 virtio_transport_has_space(struct vsock_sock= *vsk) struct virtio_vsock_sock *vvs =3D vsk->trans; s64 bytes; =20 - bytes =3D (s64)vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); + bytes =3D (s64)virtio_transport_tx_buf_alloc(vvs) - + (vvs->tx_cnt - vvs->peer_fwd_cnt); if (bytes < 0) bytes =3D 0; =20 --=20 2.34.1 From nobody Sun Feb 8 04:30:14 2026 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70DD3327202 for ; Wed, 17 Dec 2025 18:12:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995164; cv=none; b=HInDLYZTCZV6js5RQh7yFE2xoLXQHqJ9liDz+xWWiR74F1Djfq+XQKbv/LQUcpjsYJeKIBbS+vE22eHIAL+lQikOCdMpwIN6FyDHC8/ZPWeS/VkkqbnP1Es246rTjG1NmKsdgjhurGCttNdWulznibUseAsvCNt/yPsgTzU8CZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995164; c=relaxed/simple; bh=wEb7l9+dIaLrF3lOxuBu98VyqaJvK7HaA2qlpIF1m8U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tpiDLaEdm8BD6+W+8R1w7Zoc+TWp374wkKv0bdBIEnrJP+mH2+hU+XczCyFQbIzZ5MJAim6RK+jEv3cHbRCRkO43IclTcrqoSqflNSbQMLJV0fClGtq+dreDl9vrbBEL8FjADHPpQzJ9iFO9rsd9TAfIx9t4EnaJKPzKiyxVtr4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AMJmwxe6; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AMJmwxe6" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-597d57d8bb3so5188368e87.3 for ; Wed, 17 Dec 2025 10:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765995154; x=1766599954; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NbWRXdgRl3LSSNhNbS1goR3DTsrT8qwsPNUfgEKOHFM=; b=AMJmwxe6e3qInCTSDqPgOpxkBY6S+OuSUKcbnI6M3baax9apxG+fw/fm838sXn8uGb cSEk7IkO95C96WX+iPC+ue1nnUoWerPFtG1uhvGga3mHnQHs5Q60n42/4j8YJWp80QQd Y/hoBIcvOVK7XijVle7OwqQZ5NcZ0Fig0NrfQFRhhPUwlE9D7gH8ZkHGQCiKuHbvtac9 DRgPq+VNMi00peI5lHkMTdq71jKg2OiFKEf9qNKZoHavibz1Hi3i67oNpE6cJqqYLbYy m2R8eQP8JnbOx+nvEs5DLk1+UOjZhy9ME6KPQvaqrqJo7te0U+OihE8c3FFWtjM4gesc G7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765995154; x=1766599954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NbWRXdgRl3LSSNhNbS1goR3DTsrT8qwsPNUfgEKOHFM=; b=M6v5Ol1l90ozBcdOoxZl1UG5Z1b1WD5tSpNVpqbx8/1f7OOPCF7d6fcBpYKFomWaLy +5te7FcwfvVuWlBh1QoBQkaWgLs/iO5FQ9z/0GwEIYWnFn09bU3Mf/It+CyiqFAs6U6n pvMUjLqw38AgimfsV//JIzgpybV4v+X5b3CRik+s4ilmJT7hhMgONqOsW+PFXDQhPIcA uWOimoEqui8QrwwqkDncw6E55NXnf1kQpo4/3vZr2e3Z2Y2NkV4OOjxKuPZAdnqat6gs wgFstn0cVeOjvk/vlyMP5hVbNyZ/ItxzPbv1E3FfON0L3SDPNrcFGhhqOTF4SsZcjaGS b3yA== X-Forwarded-Encrypted: i=1; AJvYcCV1GOeNBQwyglLX/OShTcLI161laltPKBhpbA9vmEqbbrSEt/r6ET8N9TxWBFNl8KmcnFahdr5ofYkCWAM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0ZYBA1GzklWUhrAn0fjoCfDNJI3pQFwCjjEKDM681heYWMZQK B2OODWZ7YX5zR/v6mqeYK4lTdenXFQBDzIGOJ2ZfkYP7uxTNczP1Zegz X-Gm-Gg: AY/fxX5skkTT9AC+Ufsq4iFJsijuPQARcGC+PqsqAwg+ShGIx4ma0DuEJOEMVsCn2Ez CGEbIkfU8sAeDaeo4hXmM6bLrPVDozVrl75j+R1KywuAVVJikd3D32MOl14BGUnBIyOXv2BrCMX W2Ck7dtUqob+9XVdqFEc0RTl+UahFOcveIKHzDIayCDjJvb9nVACMTmN9n5mNF9t4cYfi3zZKpV /DR0lyo0AHhD7kbT0Uq4b+cesGoHW2SU9vUc5/HQrSdkZGfb9ZNsJf0w5O4v4UjXSVukPLBgZja MU8QDAUcqvqviTabrz76ORdzHtxSTzTdrkwdoRh4twXo8BI7pysnO9FROEcc3Xwf1iwHE3gu4Do x0JDsOV0NalQGHxE1IFwEdXcMAvwWJ75FdTm0ldLSyPd89ne0jJCwtI/hF2iquDTXUWxP9Jeup7 h9GEakzhfwuSthiM70rM48gg== X-Google-Smtp-Source: AGHT+IEL8x2ZTlMBEs3LqicoHEeKL6huCiyi0aBC5yPRWitKdewpftY1eFTFYFReON3iTv0egPnjNQ== X-Received: by 2002:a05:6512:230e:b0:598:dea9:4f4d with SMTP id 2adb3069b0e04-598faa98d29mr6053767e87.53.1765995153840; Wed, 17 Dec 2025 10:12:33 -0800 (PST) Received: from Ubuntu-2204-jammy-amd64-base.. ([2a01:4f9:6a:4e9f::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5990da790efsm2591419e87.102.2025.12.17.10.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 10:12:32 -0800 (PST) From: Melbin K Mathew To: stefanha@redhat.com, sgarzare@redhat.com Cc: kvm@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, Melbin K Mathew Subject: [PATCH net v4 3/4] vsock/test: fix seqpacket message bounds test Date: Wed, 17 Dec 2025 19:12:05 +0100 Message-Id: <20251217181206.3681159-4-mlbnkm1@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251217181206.3681159-1-mlbnkm1@gmail.com> References: <20251217181206.3681159-1-mlbnkm1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The test requires the sender (client) to send all messages before waking up the receiver (server). Since virtio-vsock had a bug and did not respect the size of the TX buffer, this test worked, but now that we have fixed the bug, it hangs because the sender fills the TX buffer before waking up the receiver. Set the buffer size in the sender (client) as well, as we already do for the receiver (server). Fixes: 5c338112e48a ("test/vsock: rework message bounds test") Suggested-by: Stefano Garzarella Signed-off-by: Melbin K Mathew --- tools/testing/vsock/vsock_test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_t= est.c index 9e1250790f33..0e8e173dfbdc 100644 --- a/tools/testing/vsock/vsock_test.c +++ b/tools/testing/vsock/vsock_test.c @@ -351,6 +351,7 @@ static void test_stream_msg_peek_server(const struct te= st_opts *opts) =20 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) { + unsigned long long sock_buf_size; unsigned long curr_hash; size_t max_msg_size; int page_size; @@ -363,6 +364,16 @@ static void test_seqpacket_msg_bounds_client(const str= uct test_opts *opts) exit(EXIT_FAILURE); } =20 + sock_buf_size =3D SOCK_BUF_SIZE; + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_MAX_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_MAX_SIZE)"); + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_SIZE)"); + /* Wait, until receiver sets buffer size. */ control_expectln("SRVREADY"); =20 --=20 2.34.1 From nobody Sun Feb 8 04:30:14 2026 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C644532D0E2 for ; Wed, 17 Dec 2025 18:12:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995164; cv=none; b=el4EFkWa11jvD2qsvP9Aji34/DAkc5fYbQxzy8c8XluJ/Tg7SZ/7+NmS2ZLyf4KWlYkvl/JOqkKfteECaG/X7P2XaW1UIlxsYj9uQVUg/3VN0Ny5WhXPAmGiorJIzdANBdqUIJbQoZcoLSoM04TH/KYMn5wuXK7LJJF7uTusTaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765995164; c=relaxed/simple; bh=Btn/e79eN7ovQAPmHnhb0d8yhq10fIOSyLkws8LR2uE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gifw/DZp2tVEdqc/Da4RbT1nauRF8V2oke3Mp+hNk7+FG3FcqNJ+nr3OheNoskmCLPv8Scps8pzZpoxV3ZfE1nA/MuYinnJDOqHb9LAkNBAN3oDHSuHgg10UQPfSgVyNSQf3950kG43Du8WxiV96uEPMYSMVvyuBTfVLbueLuiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mdGlgC/4; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mdGlgC/4" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5959d9a8eceso7427758e87.3 for ; Wed, 17 Dec 2025 10:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765995155; x=1766599955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YWDVTcbeN5bBA7b/fB7A8gJyMmAFiIZBGr/pLyGnvWw=; b=mdGlgC/4bGskD8vhG1bF6wfwggtrbIVUqUKc0jeWmrX0OXpDzcOG5esv177Upxk4eb Z7tNO16HKVWRRsisHP2qDSCkbFmMn0mdNpc0I0QDOjyaZlH8Jo2nf+7Rru4y5JiQ3IE2 lR4zBE3SXnQm/ifLg2X2G9XF2o4Q8lS+Fj9n900r9pvFaPue3Ldo0jXPTUwCrNbvycPa 18/LGl7CvoelkAoioM+KuQHWPSHiwHV7zWvIJcWn8YmTnnq7+y5NRKZ61+NB2srUm4Ne ZDKl/D/Vzn+38JMDsbHSyOUHId3vy0yDp0jwFH8vkY+bo3oQv7qQefwGOlOrY+cMo9QL +CtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765995155; x=1766599955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YWDVTcbeN5bBA7b/fB7A8gJyMmAFiIZBGr/pLyGnvWw=; b=tm3+gQTjdu1DmbDrxkYRfWo+vk2lNAP4516RFsMqiou9jxhAlK5E6ANm0j5UIIq70m KS5vZQe3Ms+y+Ey3ZbGDC0EAtki9xDxjh5V9lVC/NeekZkXBMwGdIz1SmUPjdEn4HxiT NYl/hH8nQoT4RdLTq35VE7q/anzqanaMZZzTSMJM6hf8Glr9GrTz7zsGaQ0XV5XHxuqy 7wRTc/takacRwZhMYLzAJp1qmpsZNdmTqBXo7oB7NAFhiG0TnP+Hp0caFZI4Brhp8n03 4oMlXSssrjKZqz0dTAJhDWN1L955vjfDskT9cjNnVinx7SEFaLXJ3Q0EOD+ZH3M8C62R /4tQ== X-Forwarded-Encrypted: i=1; AJvYcCUQEDKDhxu+E/8o1vQMGOvtzZ7dtMxfW7isUYbAa0kPLwQ0gmCIiYvxu/zpDzg0H9xXrf4B0bsqNzkIFUY=@vger.kernel.org X-Gm-Message-State: AOJu0YxCyhbAuh7i4kKyNWz/0x0rCwsOAsb2Gk9SsxrAeoKeWsdQgUVU CLOCpRPTveDfBvxqbMQuUuGD996rcnqz/5cAywqZOxuShoDRpjesqMm/ X-Gm-Gg: AY/fxX61Viul5DHXmwUCCuKjI/4dmLVlBGAprvBOBsKQ7hrYhzeL9Jzb+PQXzgweVPW pirw876TAbKcpt0sO1kzbyIv6O3xSQE2J6B/ulWA6UlGQU7B9sO6XbFqPK21N1aLMo0NBSEP+kA I+1whRLuZR0gxyfLigOeT5pcUGhmopkxDm4GXOb2GHdwdnY6ijKZe3IBG7sLxgfqj2BsfA7tUGm M8QjbRdjmAGk3uD+eTrHpXMHop3f9/jGcv3HV+hf0eAvmR1IoAvWyDbYWpsSPhfcsavdEi73COR Rjq7pB1SFXkAiy5dkH1bTN1H1UTOKnTj6KNcZvAmV3rZOjhE/OC5V6z3LcmLK+NqmnS1gaSgY3F 3TJ0S6Ktx0jpPTNM7jDRRZQiTbfOPHIF3w6WGQLaDv4ZI8TCAnqBIg/56SC7YuHTABlsZ+yykGM /9oWnBeoDif0U= X-Google-Smtp-Source: AGHT+IGKE6+oXrVS7pwbxHPAdksD1QodGnRBGOe+h7uD8J+gXsamVw7BpLRSwSnFwpf8bb0Jng+hIA== X-Received: by 2002:a05:6512:3d07:b0:59a:107a:45a5 with SMTP id 2adb3069b0e04-59a107a46cdmr754855e87.23.1765995154644; Wed, 17 Dec 2025 10:12:34 -0800 (PST) Received: from Ubuntu-2204-jammy-amd64-base.. ([2a01:4f9:6a:4e9f::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5990da790efsm2591419e87.102.2025.12.17.10.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 10:12:34 -0800 (PST) From: Melbin K Mathew To: stefanha@redhat.com, sgarzare@redhat.com Cc: kvm@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, Melbin K Mathew Subject: [PATCH net v4 4/4] vsock/test: add stream TX credit bounds test Date: Wed, 17 Dec 2025 19:12:06 +0100 Message-Id: <20251217181206.3681159-5-mlbnkm1@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251217181206.3681159-1-mlbnkm1@gmail.com> References: <20251217181206.3681159-1-mlbnkm1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a regression test for the TX credit bounds fix. The test verifies that a sender with a small local buffer size cannot queue excessive data even when the peer advertises a large receive buffer. The client: - Sets a small buffer size (64 KiB) - Connects to server (which advertises 2 MiB buffer) - Sends in non-blocking mode until EAGAIN - Verifies total queued data is bounded This guards against the original vulnerability where a remote peer could cause unbounded kernel memory allocation by advertising a large buffer and reading slowly. Suggested-by: Stefano Garzarella Signed-off-by: Melbin K Mathew --- tools/testing/vsock/vsock_test.c | 103 +++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_t= est.c index 0e8e173dfbdc..9f4598ee45f9 100644 --- a/tools/testing/vsock/vsock_test.c +++ b/tools/testing/vsock/vsock_test.c @@ -347,6 +347,7 @@ static void test_stream_msg_peek_server(const struct te= st_opts *opts) } =20 #define SOCK_BUF_SIZE (2 * 1024 * 1024) +#define SMALL_SOCK_BUF_SIZE (64 * 1024ULL) #define MAX_MSG_PAGES 4 =20 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) @@ -2203,6 +2204,103 @@ static void test_stream_nolinger_server(const struc= t test_opts *opts) close(fd); } =20 +static void test_stream_tx_credit_bounds_client(const struct test_opts *op= ts) +{ + unsigned long long sock_buf_size; + char buf[4096]; + size_t total =3D 0; + ssize_t sent; + int fd; + int flags; + + memset(buf, 'A', sizeof(buf)); + + fd =3D vsock_stream_connect(opts->peer_cid, opts->peer_port); + if (fd < 0) { + perror("connect"); + exit(EXIT_FAILURE); + } + + sock_buf_size =3D SMALL_SOCK_BUF_SIZE; + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_MAX_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_MAX_SIZE)"); + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_SIZE)"); + + flags =3D fcntl(fd, F_GETFL); + if (flags < 0) { + perror("fcntl(F_GETFL)"); + exit(EXIT_FAILURE); + } + + if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) { + perror("fcntl(F_SETFL)"); + exit(EXIT_FAILURE); + } + + control_expectln("SRVREADY"); + + for (;;) { + sent =3D send(fd, buf, sizeof(buf), 0); + if (sent > 0) { + total +=3D sent; + continue; + } + if (sent < 0 && (errno =3D=3D EAGAIN || errno =3D=3D EWOULDBLOCK)) + break; + + perror("send"); + exit(EXIT_FAILURE); + } + + /* + * With TX credit bounded by local buffer size, sending should + * stall quickly. Allow some overhead but fail if we queued an + * unreasonable amount. + */ + if (total > (size_t)(SMALL_SOCK_BUF_SIZE * 4)) { + fprintf(stderr, + "TX credit too large: queued %zu bytes (expected <=3D %llu)\n", + total, (unsigned long long)(SMALL_SOCK_BUF_SIZE * 4)); + exit(EXIT_FAILURE); + } + + control_writeln("CLIDONE"); + close(fd); +} + +static void test_stream_tx_credit_bounds_server(const struct test_opts *op= ts) +{ + unsigned long long sock_buf_size; + int fd; + + fd =3D vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); + if (fd < 0) { + perror("accept"); + exit(EXIT_FAILURE); + } + + /* Server advertises large buffer; client should still be bounded */ + sock_buf_size =3D SOCK_BUF_SIZE; + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_MAX_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_MAX_SIZE)"); + + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_SIZE, + sock_buf_size, + "setsockopt(SO_VM_SOCKETS_BUFFER_SIZE)"); + + control_writeln("SRVREADY"); + control_expectln("CLIDONE"); + + close(fd); +} + static struct test_case test_cases[] =3D { { .name =3D "SOCK_STREAM connection reset", @@ -2382,6 +2480,11 @@ static struct test_case test_cases[] =3D { .run_client =3D test_seqpacket_unread_bytes_client, .run_server =3D test_seqpacket_unread_bytes_server, }, + { + .name =3D "SOCK_STREAM TX credit bounds", + .run_client =3D test_stream_tx_credit_bounds_client, + .run_server =3D test_stream_tx_credit_bounds_server, + }, {}, }; =20 --=20 2.34.1