From: Stefano Brivio <sbrivio@redhat.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: david@gibson.dropbear.id.au, passt-dev@passt.top
Subject: Re: [PATCH v3] util, passt: Close daemon-lifetime fds on exit to avoid Coverity warning
Date: Fri, 12 Jun 2026 10:06:45 +0200 (CEST) [thread overview]
Message-ID: <20260612100644.03c7e996@elisabeth> (raw)
In-Reply-To: <20260611151521.2056150-1-jmaloy@redhat.com>
On Thu, 11 Jun 2026 11:15:21 -0400
Jon Maloy <jmaloy@redhat.com> 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 <jmaloy@redhat.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
>
> ---
> 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
prev parent reply other threads:[~2026-06-12 8:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 15:15 Jon Maloy
2026-06-12 8:06 ` Stefano Brivio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260612100644.03c7e996@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=jmaloy@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).