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=aNc+0DYT; 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 A94365A0265 for ; Tue, 10 Mar 2026 16:11:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773155492; 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: in-reply-to:in-reply-to:references:references; bh=o24lxlyxcgcrZQ1wSWfueTsiI2zeP3NNzalyi8RRZ4w=; b=aNc+0DYTlMuPRWASaOWaMbv2I3UzISIhIFaEwJt3gpnygqibnPio69wpLilDVsjVaBwoEE 9fSlhR/6kp7EMcRDfSwOp+3wFyZm5AnGAfea1OTSJ7rWZLuGwLSwOUo2KqdqHKhvTT0AZn FT+yinwBq96CUnzWdmnLSK3i/aBwFS0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-494-X05kESBxNTSTbipf-TvRFg-1; Tue, 10 Mar 2026 11:11:30 -0400 X-MC-Unique: X05kESBxNTSTbipf-TvRFg-1 X-Mimecast-MFC-AGG-ID: X05kESBxNTSTbipf-TvRFg_1773155489 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4852cf0318dso38425965e9.3 for ; Tue, 10 Mar 2026 08:11:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773155489; x=1773760289; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o24lxlyxcgcrZQ1wSWfueTsiI2zeP3NNzalyi8RRZ4w=; b=vDQ006RV+5Kptgiq1t64wzgbggs8m6lqCNca//1ZbMA8p420FOEGYeSfIphhxsJRM7 RfKumazDqpN9n3d9ROp5WSkOCg2cX61d00fMxlyh6vyHgtl5J2uengShnWxEjGwJgo8s 425758iCxw83uW/6keAdfDr/T+jXmT0FCo+Hf8H0tM4FrhNpPU5o/4XJwxPbNlEjzRv1 9S7LzNgP3yHWsXnfo89YKQVEB/M765ZlksoTIoSEm/z0P8gNsj6O1vf+W/b5uBUrDgvy sebK6+DoKYNNZJ6VGsqQkmnxpbyWTZBrfAFk/qz3V+EwB3i8vcMkRIspQACa/KkgGDjF YhYg== X-Gm-Message-State: AOJu0YxCQY0xvT+P35l+bL3RyiZmIA7/WSdby/7kcotI9FnijpEbI4OQ HVTFjpmc1goYoaetz2aO0tcByoNfXofjss8tHEtGYcSJqKhcwG2eG9Da2FLy4vjfsqzD+S7QXcK xjExmrqdjubGqiITp8BgCoidOvTCXV55QDOH6Jboq7yKlZkt3s9ghPQ== X-Gm-Gg: ATEYQzx0UP4be+nuZ4kmidy2jb1rMGB/K6esIH9iNpSyY9gxE2GjOPaIaoxyUi3N29i AvbzvYJaq/iNt1j+NqfMtqBy8uezY/J2zSlJ4sE8VEtkFEAYrsDGV4dlqwbeFb1ot2PBpCqh0eZ gxwTy10EKnnvRce8xhiaiRsCqlO6qeg8mZ8tlGH2af5F0RUB6+9TjCHx7rqlU1TBBPx+ZUxATTr es6AUEC67Ndg9Nrq4LOZS4VkpU47XkDDhQ8/g9XZCBLcMtEXqwHZK9cepmxoENZy4Kk1954PdRf TA2f2+KRVVNFkpSJbWLs3lKiDqxsQ1qNckbVUSfiaOBSYM7Y82JFLTkLrUdSSgiaej2yiEinjCx V39TFiHV7PZ3cdIFRTpVWbouo9q1LmWir X-Received: by 2002:a05:600c:1d24:b0:485:39b9:96a1 with SMTP id 5b1f17b1804b1-48539b998d8mr148063605e9.19.1773155489367; Tue, 10 Mar 2026 08:11:29 -0700 (PDT) X-Received: by 2002:a05:600c:1d24:b0:485:39b9:96a1 with SMTP id 5b1f17b1804b1-48539b998d8mr148062995e9.19.1773155488828; Tue, 10 Mar 2026 08:11:28 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48541aa7aacsm101364415e9.13.2026.03.10.08.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 08:11:28 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v4] iov: Add iov_truncate() helper and use it in vu handlers Message-ID: <20260310161126.4b3c0f56@elisabeth> In-Reply-To: <20260306115119.1589020-1-lvivier@redhat.com> References: <20260306115119.1589020-1-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Tue, 10 Mar 2026 16:11:27 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Odr0wa_Ci-usCqtb4EC-0RE2fDxUFf28JiVmAKGaM2U_1773155489 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: YIM42CFAQPET5P7C4UJDJQMR36VHYBTI X-Message-ID-Hash: YIM42CFAQPET5P7C4UJDJQMR36VHYBTI X-MailFrom: sbrivio@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: passt-dev@passt.top, David Gibson 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: On Fri, 6 Mar 2026 12:51:19 +0100 Laurent Vivier wrote: > Add a generic iov_truncate() function that truncates an IO vector to a > given number of bytes, returning the number of iov entries that contain > data after truncation. > > Use it in udp_vu_sock_recv() and tcp_vu_sock_recv() to replace the > open-coded truncation logic that adjusted iov entries after recvmsg(). > Also convert the direct iov_len assignment in tcp_vu_send_flag() to use > iov_truncate() for consistency. > > Add an ASSERT() in tcp_vu_data_from_sock() to quiet the Coverity error: > > passt/tcp_vu.c:457:3: > 19. overflow_const: Expression "dlen + hdrlen", where "dlen" is known to > be equal to -86, and "hdrlen" is known to be equal to 86, underflows > the type of "dlen + hdrlen", which is type "unsigned long". > > Signed-off-by: Laurent Vivier > --- > > Notes: > v4: add ASSERT() to quiet the Coverity error > v3: use in tcp_vu_send_flag() too > v2: use iov_truncate() in udp_vu_sock_recv() too Applied. -- Stefano