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=hu69glEk; 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 C4CE85A0262 for ; Fri, 12 Jun 2026 10:06:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781251609; 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=pTFeM0x1TSc4p3qn+SDk6FmWZjvrSFZCY5Z3q18EU9A=; b=hu69glEka+zscJZJoggmm3WiUJmTPO8k4ANP1WFkwpenxflUu2DFsLEq6MRqUrQoej5e0E lXy/g8X7KcPFsz0NFHs9w4Vh3wZmLZY5bD1EtBe8/UaqxZEiuOUHl7cPX8+jspN4Mivxuj iuwwIuIIMqadwrYpLRuHHbA5XARCoXc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-Gg_ZOJ-HPqGRqXc3JZLHDg-1; Fri, 12 Jun 2026 04:06:48 -0400 X-MC-Unique: Gg_ZOJ-HPqGRqXc3JZLHDg-1 X-Mimecast-MFC-AGG-ID: Gg_ZOJ-HPqGRqXc3JZLHDg_1781251607 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-45efa2f7009so442430f8f.3 for ; Fri, 12 Jun 2026 01:06:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781251607; x=1781856407; 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=pTFeM0x1TSc4p3qn+SDk6FmWZjvrSFZCY5Z3q18EU9A=; b=JpYD9ED3U/mn1vGCs/DJAzLV/1K05A6FMkCLrwWhj5RDnuibrivlpOHtbpRY+KiDov tcK6VClrdRqX8uLzxJv/mzB9PemHqnbzaQuVb97X3yfU6fpT7aIsiT4yrd820daY2aXL MoD9J2S6V93GgfeyVyCUl8bmV/ONWMqZYSqzJgvX9/WVdG/rjwvaqsv497VwPh3bd7BP RRO5ipv4pLhp94fuQ4B+v4i+af5tMTlnSb4G0NLKpHaiEl2Uvg04QP4pWP7fYr2qgkCl lk+6+AWwhnzpW9i/OC11NldyGrLwu+Hb4cgYk8MdOmnyo4seKu/3BTI50qiPVZ4m8u+G 53fg== X-Forwarded-Encrypted: i=1; AFNElJ9F7iRZ1OrJRLGXH360PVW0cC+KNuHmtl1AqR8UvNEwKu0pvwsJoDYF8ZtTtxtCQGoiFO46l4/RTRo=@passt.top X-Gm-Message-State: AOJu0YwezwNn4o64P166GsSRqGx/tnIbCg7dYvHN9/bc7n7p+iL/h1le UwIozWS/Sh3x4/hzV+7vfapsJeBJYCg1nJ7kc6BGfZEIEZ9PLXNVpEynrNHUDyRXqCInXtKql6A er5iphYNqPJJ03MiTEsniNcwCmXNVpy6DsGcT7OJwJzRrNvhgGwwh/w== X-Gm-Gg: Acq92OE/kqXYoFGkmyA4Ywx8vW/WEnRczQuUvqk2jKi9Sggue7o+Ek4Gcbr36DSLrSf 93aZFd6ZOI2Wtc0UFpK0G3zUFa4KXz9psPyh8q3cB+sSiRd7h9k+j/cKnyffown6rCK7h8aSh87 fja8nvVvgVcaHEZ7iFUBIdw1xe2XqRlgpmgqOUTgufHPXohX9HK9Z4SbIzDasKj91idd27o6RDq OG4UBMrX8UDpCrpGUDme/7NkSl5jQlU7nZT7sJsjd55VsgfTziMu47cB4V0J5+69Lw+xXNI94M+ 5c5H4F++cdVnsWtX8ZPqQnj6Tom2JsyAq5/3fRRY9758ZBWMCBStWI2dN7mN8xz3cZ9etpyOrL8 QRyQO91SkHNltjfMMQRQE/rnbFFOS/eG+bnYf3lOfsTGTkF7/7Q== X-Received: by 2002:a05:6000:38a:b0:452:75ca:3fab with SMTP id ffacd0b85a97d-4606dbbef44mr2364695f8f.38.1781251606745; Fri, 12 Jun 2026 01:06:46 -0700 (PDT) X-Received: by 2002:a05:6000:38a:b0:452:75ca:3fab with SMTP id ffacd0b85a97d-4606dbbef44mr2364635f8f.38.1781251606114; Fri, 12 Jun 2026 01:06:46 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f2b0c10sm3596547f8f.21.2026.06.12.01.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 01:06:45 -0700 (PDT) From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v3] util, passt: Close daemon-lifetime fds on exit to avoid Coverity warning Message-ID: <20260612100644.03c7e996@elisabeth> In-Reply-To: <20260611151521.2056150-1-jmaloy@redhat.com> References: <20260611151521.2056150-1-jmaloy@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: Fri, 12 Jun 2026 10:06:45 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OHtuZq5IW9oJ4WPDfPOmKpvfC-NV12yE1Kjisa9zgJg_1781251607 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: CJGPEZYOJGHXREW53X7AEUAI42HPANT2 X-Message-ID-Hash: CJGPEZYOJGHXREW53X7AEUAI42HPANT2 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: david@gibson.dropbear.id.au, passt-dev@passt.top 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 Thu, 11 Jun 2026 11:15:21 -0400 Jon Maloy wrote: > conf_open_files() opens three file descriptors (fd_tap_listen, > fd_repair_listen, fd_control_listen) that are held for the entire > daemon lifetime. Because no close() call exists for them > anywhere, Coverity flags each as INCOMPLETE_DEALLOCATOR. This is > clearly a false positive, but we still want to get rid of this > warning. > > We now register the execution context in global area so that > passt_exit() can use it to close these descriptors before calling > _exit(). All exit paths (signal handler, die(), die_perror()) > funnel through passt_exit(), so this covers all cases. > > Signed-off-by: Jon Maloy > Reviewed-by: David Gibson > > --- > v2: - Made struct ctx global from the beginning, on suggestion > from David Gibson. > - Drop pidfile_fd from passt_exit() cleanup, since it can be > closed directly after use. > v3: - Moved stack declaration of struct *ctx in main() so it fits > the reverse Christmas-tree order. Applied. -- Stefano