public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
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: Fri, 4 Dec 2026 19:42:16 +0100	[thread overview]
Message-ID: <2b7695c7-dff6-43c0-bb31-dffa097714a9@lix.systems> (raw)
In-Reply-To: <20261202124901.0ab686fd@elisabeth>

On 02/12/2026 12:49, Stefano Brivio wrote:
>> we don't fully understand why a readiness fd is scary here
> 
> Because you can do a lot of things on a file descriptor, and it's one
> more thing from the "outside world" pasta could touch.  It's not
> particularly scary, it's just as scary as other interfaces.  And the
> fewer interfaces we can have, the better.
> 
>> but we're
>> also not that well-versed in how the different LSMs treat inherited file
>> descriptors.
> 
> Actually, I had something completely unrelated in mind when I wrote
> that.  I was mistakenly thinking of something path-based, sorry.  It
> wouldn't be the case.  So, actually, policy-wise it's all unproblematic.
> 
> That's one aspect that makes it a bit more scary though: LSMs wouldn't
> see that at all.  You can say stuff like "pasta is allowed to receive
> SIGTERM from Podman" (and no other signals, from no other processes),
> but you can't decide what pasta can do with that file descriptor at
> all: everything goes, including, say, calling fsconfig(2) on it.

the same thing goes for 0/1/2 though, and you don't close any of those 
despite not using them (which gave us the inheritance crimes in the 
first place), hence the confusion why adding one more would be such a 
big deal. but we guess you'd need to explicitly set pasta up for failure 
with those much more than with other fd numbers and treating those two 
sets as different interfaces for that reason does make sense

>> 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.
> 
> Hmm, what if pasta optionally writes its PID to stdout, as Paul was also
> proposing on that ticket?  That's an interface we already have.

we've already tested this in principle, but haven't had the time to 
integrate it in lix and test it there. this does seem to work (thanks 
--pid /dev/stout), it just has the slight annoyance factor that stdout 
isn't closed once the pid is written. we can totally live with that 
though; pid on stdout is a fine signal for startup completion :)

> By the way, we eventually had to add another interface, recently, which
> is a full-fledged (optional) control socket, because container runtimes
> need to add and remove port mappings at runtime.
> 
> It can be accessed via pesto(1) using a simple binary protocol.  It's a
> more involved interface, indeed, but we couldn't avoid it, and access
> is policed via regular filesystem permissions as well as via LSMs.  On
> top of that, pasta doesn't get any file descriptor from another
> process: it's a UNIX domain socket with its abstraction, which also
> offers some implicit isolation.
> 
> If there's the possibility that Lix might need to use it as well in the
> future, then we could just use that right now to terminate pasta.  We
> could even ship a minimal client, say, basta(1), whose only job is to
> write a single "quit" command to the UNIX domain socket.  Would that be
> appealing in any way?

using the control interface isn't out of the question in the future, but 
we don't see any need for runtime configuration at this point. if pasta 
prefers to be shut down via the control socket we can do that, the 
protocol looks like something we could implement very easily (and would 
prefer to do so over using pesto for time being, our process 
abstractions are not currently well-suited for short-running utility 
commands. this'll change at some indeterminate point in the future)

  reply	other threads:[~2026-12-04 18:42 UTC|newest]

Thread overview: 11+ 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
2026-12-02 11:49         ` Stefano Brivio
2026-12-04 18:42           ` eldritch horrors [this message]
2026-12-05  1:14             ` eldritch horrors
2026-12-05 23:30             ` 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=2b7695c7-dff6-43c0-bb31-dffa097714a9@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).