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=d7vCzE2F; 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 ESMTPS id 92EB35A0265 for ; Thu, 09 Jul 2026 23:57:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783634223; 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; bh=52RexWJQnNSDrS8jupe4X4bVMXASGLWil4F2VNXJxK0=; b=d7vCzE2FiJM5wF85FV5COV1UuHjhKRHDlkfpWE04YYoa0uenByTMudhs3iukcFUqRq5BfU pp26ZKEEPiT6h04BaSeklWyDZMh6Ht+sZSchAoxid7Dav28eXFhlEeXepijdIIn96DUOeq uT3C4rtoyqtWkYSGDMSA+LZhv/yZH4s= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-Qz9BTjkBNdmAI7nBkG_rpA-1; Thu, 09 Jul 2026 17:57:02 -0400 X-MC-Unique: Qz9BTjkBNdmAI7nBkG_rpA-1 X-Mimecast-MFC-AGG-ID: Qz9BTjkBNdmAI7nBkG_rpA_1783634221 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A435618005A6; Thu, 9 Jul 2026 21:57:00 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.rmtcaqc.csb (unknown [10.22.88.44]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A9E57195608A; Thu, 9 Jul 2026 21:56:58 +0000 (UTC) From: Jon Maloy To: sbrivio@redhat.com, david@gibson.dropbear.id.au, jmaloy@redhat.com, passt-dev@passt.top Subject: [PATCH v2 0/6] Fix issues and false positives from static analysis Date: Thu, 9 Jul 2026 17:56:50 -0400 Message-ID: <20260709215656.1351549-1-jmaloy@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: EDp2QNJxa-PZMQXIJpNZ3LfvmqzdmuzNlm1ADaUlwQQ_1783634221 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: RCA67HWKG4QUSHZGY4UCKMBZTLFIIQK6 X-Message-ID-Hash: RCA67HWKG4QUSHZGY4UCKMBZTLFIIQK6 X-MailFrom: jmaloy@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: This series fixes minor issues found by static analysis tools in the main passt code and in documentation examples. The core code changes add missing fd initialisations and guard unsigned arithmetic against potential underflow. We also fix buffer handling, type mismatches, and resource leaks in the documentation example code. v2: - udp_vu, tap: Use if-guards instead of assert(), to handle the error paths properly and let the static checker follow the logic - doc/migration: Use snprintf() instead of strncpy() for clarity and guaranteed null-termination (David Gibson) - Drop va_list initialisation patch (Stefano Brivio, David Gibson) Jon Maloy (6): passt: Initialise listening socket fds to -1 udp_vu: Check iov_tail_clone() return before assigning to msg_iovlen tap: Guard IPv6 tail size subtraction against underflow doc/migration: Use snprintf() for socket path and fix argv access doc/migration: Fix buffer type mismatch in recv() call doc/platform-requirements: Close leaked sockets in test_close_dup() doc/migration/source.c | 2 +- doc/migration/target.c | 10 ++++------ doc/platform-requirements/udp-close-dup.c | 3 +++ passt.c | 3 +++ tap.c | 5 ++++- udp_vu.c | 8 ++++++-- 6 files changed, 21 insertions(+), 10 deletions(-) -- 2.52.0