From: eldritch horrors <pennae@lix.systems>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>,
passt-dev@passt.top, raito@lix.systems, sergei@zimmerman.foo,
Paul Holzinger <pholzing@redhat.com>
Subject: Re: pasta: patches for --pass-fds (fix) and --ready-fd (new)
Date: Sun, 29 Nov 2026 21:11:22 +0100 [thread overview]
Message-ID: <6d2ed11c-0109-409c-b584-adbdc43fb862@lix.systems> (raw)
In-Reply-To: <20261127232541.2474fc81@elisabeth>
hi,
On 27/11/2026 23:25, Stefano Brivio wrote:
> I think we had some issue with this at some point, it works for me now,
> but I have a vague memory of another use case (probably Buildah?) where
> this wasn't a possibility at all. I tried both:
we've retested these, and today they work. we can totally pass a PID to
pasta and have it open its namespace files, so that's no longer a
problem. excellent :) we're no longer sure what the original problem was
here, but that bit does look solved without any sort of fd passing.
>> we also need to tear down pasta *quickly* once our processes using the
>> isolated network terminate. we can run hundreds of them per second,
>> leaving pasta instances around until they find the namespace gone is the
>> kind of drain on resources our scheduler wants to avoid, and on highly
>> loaded system we can't even guarantee that any given pasta instance can
>> check whether its namespaces are still live in any reasonable amount of
>> time.
>
> Hmm, okay, if you can't give pasta a namespace handle, then pasta's own
> clean-up mechanism won't be quick (see commit I mentioned above
> introducing a timer for that).
>
> I think the most appropriate solution would be the pidfd idea outlined
> here as "option 2":
>
> https://github.com/podman-container-tools/podman/pull/27901#issuecomment-3819074744
>
> which could actually be entirely race-free:
>
> https://github.com/podman-container-tools/podman/pull/27901#issuecomment-3823473179
>
> ...so that you can keep the clean synchronisation / demonisation on
> start-up, and still have a fast and robust mechanism to terminate it.
> What do you think?
that could be workable, but "works since 6.14" is a caveat we currently
can't work with. we've checked the linux source, and 6.14 is indeed a
lower bound for when this trick would work.
we don't fully understand why a readiness fd is scary here, but we're
also not that well-versed in how the different LSMs treat inherited file
descriptors. we'd be totally happy if pasta just kept an fd to close
where it would normally fork, with nothing else done to the fd under any
circumstances.
all this aside it seems that we could use the pidfile option to have
pasta write its pid to a fifo and use the appearance of data as a "would
have daemonized here" signal. this feels strictly inferior to a
readiness fd passed via inheritance[1], but we do suppose (without
having tested it yet) that this should work. if it does we'd have a
significantly less crimes-y solution with current pasta versions, but
we'd still prefer a readiness fd for signaling. that just seems like the
much cleaner solution on the consumer side, with no filesystem pollution
or other interference to worry about.
[1]: having a stable name in the filesystem would let other applications
very easily signal pasta readiness and subsequently either have pasta
hang (if we don't unlink the fifo as early as possible) or write junk to
disk (if we do unlink the fifo early), though this is also a potential
problem with inherited fds thanks to the /proc/*/fd/* links. closing an
inherited fd is not vulnerable to this kind of interference; we can
inject data via magic links, but not closes.
next prev parent reply other threads:[~2026-11-29 20:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 22:11 Lisanna Dettwyler
2026-11-24 18:20 ` Stefano Brivio
2026-11-24 18:46 ` Sergei Zimmerman
2026-11-24 21:32 ` Stefano Brivio
2026-11-26 19:04 ` eldritch horrors
2026-11-27 22:25 ` Stefano Brivio
2026-11-29 20:11 ` eldritch horrors [this message]
2026-12-02 11:49 ` Stefano Brivio
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=6d2ed11c-0109-409c-b584-adbdc43fb862@lix.systems \
--to=pennae@lix.systems \
--cc=lisanna.dettwyler@gmail.com \
--cc=passt-dev@passt.top \
--cc=pholzing@redhat.com \
--cc=raito@lix.systems \
--cc=sbrivio@redhat.com \
--cc=sergei@zimmerman.foo \
/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).