From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Fs0AZH1H; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 8AFAC5A0775 for ; Thu, 12 Feb 2026 12:39:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770896377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ygPcnObPdAM5qrB+v0ig1HktUOvmymPHLOD/Q34077c=; b=Fs0AZH1HhaEzTRFDTOek11hw838wobNoXGzkj9OSWkcg7ZjM6gLe0Q4UWSvn6EhpocgX5/ R+mRTEpufU68ZN3E+0ic/uqb82+KwIOmb7GwMmBR/UVTrSNidQ8wf2cCF38q76ZX2SUhnJ 0Ao4TVdoZIPbJBvZ6sW2wNcegMHD85E= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-340-BhdyG1L8PC6MItV6XHd2mw-1; Thu, 12 Feb 2026 06:39:36 -0500 X-MC-Unique: BhdyG1L8PC6MItV6XHd2mw-1 X-Mimecast-MFC-AGG-ID: BhdyG1L8PC6MItV6XHd2mw_1770896375 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B81D1956066 for ; Thu, 12 Feb 2026 11:39:35 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.44.33.7]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 08DA819560B9; Thu, 12 Feb 2026 11:39:33 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/2] Fix minimum frame size checks in vhost-user paths Date: Thu, 12 Feb 2026 12:39:30 +0100 Message-ID: <20260212113932.1047788-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: e4pwQqQ0iZFq0xqZKyNWZi-VZBaLinfx74XozSq6mMg_1770896375 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6DO4HDUZFJQRBJRYVPVHMHN3SXLGVHSV X-Message-ID-Hash: 6DO4HDUZFJQRBJRYVPVHMHN3SXLGVHSV X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In the vhost-user code paths, buffers from the virtio queue include=0D a virtio net header prepended to the Ethernet frame. The minimum=0D frame size checks (ETH_ZLEN, i.e. 60 bytes per IEEE 802.3) must=0D account for this extra header, otherwise the size requested from=0D vu_collect() and validated in ASSERT() is too small.=0D =0D This two-patch series:=0D =0D 1. Introduce a VNET_HLEN macro in virtio.h to replace all open-coded=0D sizeof(struct virtio_net_hdr_mrg_rxbuf) throughout the vhost-user=0D code, improving readability and consistency.=0D =0D 2. Fix the minimum frame size calculations in tcp_vu.c and udp_vu.c=0D to use ETH_ZLEN + VNET_HLEN instead of bare ETH_ZLEN, correctly=0D accounting for the virtio net header in the buffer size.=0D =0D Laurent Vivier (2):=0D virtio: Introduce VNET_HLEN macro for virtio net header length=0D tcp_vu, udp_vu: Account for virtio net header in minimum frame size=0D =0D tcp_vu.c | 29 +++++++++++------------------=0D udp_vu.c | 14 +++++---------=0D virtio.h | 2 ++=0D vu_common.c | 13 +++++--------=0D vu_common.h | 2 +-=0D 5 files changed, 24 insertions(+), 36 deletions(-)=0D =0D --=20=0D 2.52.0=0D =0D