From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=cai6PqX6; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id E5A115A004E for ; Wed, 27 Nov 2024 15:59:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732719592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=PT0g1o1jtFJKda5eBP/IpA/RkDuD/KIKL+TbCfERO5U=; b=cai6PqX6H6uEjhlEvpNGcQcuM/dDQA35mkuDVMzN+Sh8oq+utK/MeSwp+T3sAi8eEIGnYv wgYsPlsOfMdTm2U4cUDcsluHWJ0pT6spoo2oA5C1950d/Uk/MLp87JmK2znRVK6v0V7vo8 mbHsRg7t6OS9ds7Mm4gVUXst+UC7Uxo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-IUb6F_Q2N_2AWxMBQBrYhQ-1; Wed, 27 Nov 2024 09:59:50 -0500 X-MC-Unique: IUb6F_Q2N_2AWxMBQBrYhQ-1 X-Mimecast-MFC-AGG-ID: IUb6F_Q2N_2AWxMBQBrYhQ Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434ad71268dso1106595e9.1 for ; Wed, 27 Nov 2024 06:59:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732719589; x=1733324389; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PT0g1o1jtFJKda5eBP/IpA/RkDuD/KIKL+TbCfERO5U=; b=blMkAYYnRz907/jZCPjIUNIaGQkI0vvelZWMt3+AiPWCR4PDpp69byY4PR5qXeySjt h6c9PSIYOC5YYPlw/qeTAo+Mkw4XdQUhMAzAQfgbq5yqjIzf37DYnU86nFclmrkft38U eRc9nXxW3KSNqKPFiIHxk5d7XrXyYd28psOErSFC7NUjIJdHDaAzqValVUhKe4x47Ctm oV5uGRg0R/HOzSLt5rgf6o8bCa+cAlp2xp27G8ZIL9+dAXfvghEy6RK4gd19NSX5R3+8 tkxcNtLhHVrQl+9HTgaX39x29BvExce5rXXnOy71ah9gsald3vb4rwtzWJlpTxEKc1ZA eG/Q== X-Forwarded-Encrypted: i=1; AJvYcCW9pcqTotSHGH8weaXT3Jaf9WHUiOw3R44+TcK43t0h2pPj2vmrpWjGpFjo79GI0yWjOAGX+Pa/ArE=@passt.top X-Gm-Message-State: AOJu0Yw7ZNtWnpXHmooN7rGhhD+++USexVujGUNGLWh1SZgIj2iUMqPe U9cq2BC8WXSl5Jtx/MUE55Aof8qc3wbIfrmdbBJqO8yC8J7OsGaGYOEeOCxcsC4tsK8TKLCsIkL EhFic8HmdPmYt+X77Nigamicv11xhtOl3GChOJjMHa6yFDicJNvcLnhc0cw== X-Gm-Gg: ASbGncuxorEP4l4ShkOcpFQb19YEOuZxtvXAWwQSccxOjzCko44VuT3EDGp4po3pqs3 t/4Ir8f6yuhweMshNADlNKn68o95XcNg+kwT8nEn83fGV4AT/9+YEK2jC9myToFgrHd2BKvPI23 0dFRsXOaQ1ArOqOduc3hYjFLWpG4z52e+fyrKJ1XwyTIaTicrjt1jTum4bcBdV/DNb6H+dSVW/M 2dOpBl8enqE4NSgUwfQ3fiYK6B/QNPjKWc2N3TLTtQ8gDBs10AkDLsM9S69w8y2wj0HS5vCwcIb gMbnRl8h7npA X-Received: by 2002:a05:600c:ccd:b0:434:a4d3:31f0 with SMTP id 5b1f17b1804b1-434a9de0692mr30068225e9.3.1732719589357; Wed, 27 Nov 2024 06:59:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmxu1beMM8PJrmryplIpGWhEywj2sEKVuzYu/miGM2ZzncXdSnunAZNb8xYNy8thxxOOk+Aw== X-Received: by 2002:a05:600c:ccd:b0:434:a4d3:31f0 with SMTP id 5b1f17b1804b1-434a9de0692mr30068105e9.3.1732719589051; Wed, 27 Nov 2024 06:59:49 -0800 (PST) Received: from ?IPV6:2a01:e0a:e10:ef90:343a:68f:2e91:95c? ([2a01:e0a:e10:ef90:343a:68f:2e91:95c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e0ca4sm23119355e9.28.2024.11.27.06.59.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Nov 2024 06:59:48 -0800 (PST) Message-ID: <14f5881a-8431-4b02-8028-f1bf4fb2f77c@redhat.com> Date: Wed, 27 Nov 2024 15:59:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tcp_vu: Change 'dlen' to ssize_t in tcp_vu_data_from_sock() To: Stefano Brivio , passt-dev@passt.top References: <20241127144327.3778810-1-sbrivio@redhat.com> From: Laurent Vivier Autocrypt: addr=lvivier@redhat.com; keydata= xsFNBFYFJhkBEAC2me7w2+RizYOKZM+vZCx69GTewOwqzHrrHSG07MUAxJ6AY29/+HYf6EY2 WoeuLWDmXE7A3oJoIsRecD6BXHTb0OYS20lS608anr3B0xn5g0BX7es9Mw+hV/pL+63EOCVm SUVTEQwbGQN62guOKnJJJfphbbv82glIC/Ei4Ky8BwZkUuXd7d5NFJKC9/GDrbWdj75cDNQx UZ9XXbXEKY9MHX83Uy7JFoiFDMOVHn55HnncflUncO0zDzY7CxFeQFwYRbsCXOUL9yBtqLer Ky8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rM1fzzb8JtAuSbuzZSQPDwQEI5CKKxp7zf76J21YeRrEW4WDznPyVcDTa+tz++q2S/Bp P4W98bXCBIuQgs2m+OflERv5c3Ojldp04/S4NEjXEYRWdiCxN7ca5iPml5gLtuvhJMSy36gl U6IW9kn30IWuSoBpTkgV7rLUEhh9Ms82VWW/h2TxL8enfx40PrfbDtWwqRID3WY8jLrjKfTd R3LW8BnUDNkG+c4FzvvGUs8AvuqxxyHbXAfDx9o/jXfPHVRmJVhSmd+hC3mcQ+4iX5bBPBPM oDqSoLt5w9GoQQ6gDVP2ZjTWqwSRMLzNr37rJjZ1pt0DCMMTbiYIUcrhX8eveCJtY7NGWNyx FCRkhxRuGcpwPmRVDwOl39MB3iTsRighiMnijkbLXiKoJ5CDVvX5yicNqYJPKh5MFXN1bvsB kmYiStMRbrD0HoY1kx5/VozBtc70OU0EB8Wrv9hZD+Ofp0T3KOr1RUHvCZoLURfFhSQ= In-Reply-To: <20241127144327.3778810-1-sbrivio@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dnOh7Pa3wxW_Rtovyc5iGOxsPDGfcA5b7rbQvN86Ixo_1732719589 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: D2EE5Z6F4QIKA3H55ERBDLKTHBBCJOOR X-Message-ID-Hash: D2EE5Z6F4QIKA3H55ERBDLKTHBBCJOOR 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 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 27/11/2024 15:43, Stefano Brivio wrote: > ...to quickly suppress a false positive from Coverity, which assumes > that iov_size is 0 and 'dlen' might overflow as a result (with hdrlen > being 66). An ASSERT() in tcp_vu_sock_recv() already guarantees that > iov_size(iov, buf_cnt) here is anyway greater than 'hdrlen'. > > Signed-off-by: Stefano Brivio > --- > This applies on top of "[PATCH] Fix build on 32bit target" > > tcp_vu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tcp_vu.c b/tcp_vu.c > index 05e2d1d..a1510d9 100644 > --- a/tcp_vu.c > +++ b/tcp_vu.c > @@ -462,7 +462,7 @@ int tcp_vu_data_from_sock(const struct ctx *c, struct tcp_tap_conn *conn) > for (i = 0, check = NULL; i < head_cnt; i++) { > struct iovec *iov = &elem[head[i]].in_sg[0]; > int buf_cnt = head[i + 1] - head[i]; > - int dlen = iov_size(iov, buf_cnt) - hdrlen; > + ssize_t dlen = iov_size(iov, buf_cnt) - hdrlen; > > vu_set_vnethdr(vdev, iov->iov_base, buf_cnt); > Reviewed-by: Laurent Vivier