From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=lix.systems Received: from mail.eno.space (eno.space [49.12.14.75]) by passt.top (Postfix) with ESMTPS id 363135A0274 for ; Fri, 04 Dec 2026 19:42:19 +0100 (CET) Received: from [IPV6:2a02:810b:4d0c:d00:9795:6509:2346:6bdd] (unknown [IPv6:2a02:810b:4d0c:d00:9795:6509:2346:6bdd]) by mail.eno.space (Postfix) with ESMTPSA id 4jh0j55nx9z7ntCv; Fri, 04 Dec 2026 19:42:17 +0100 (CET) Message-ID: <2b7695c7-dff6-43c0-bb31-dffa097714a9@lix.systems> Date: Fri, 4 Dec 2026 19:42:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pasta: patches for --pass-fds (fix) and --ready-fd (new) Content-Language: en-US To: Stefano Brivio References: <20261124192024.0e16f855@elisabeth> <6a3d919f-8fe9-4473-ac11-7d3d1a4b6173@lix.systems> <20261127232541.2474fc81@elisabeth> <6d2ed11c-0109-409c-b584-adbdc43fb862@lix.systems> <20261202124901.0ab686fd@elisabeth> From: eldritch horrors In-Reply-To: <20261202124901.0ab686fd@elisabeth> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MailFrom: pennae@lix.systems X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: ZVGDNGPXPMEL3L2PVTMUT2U4UVEJL2V7 X-Message-ID-Hash: ZVGDNGPXPMEL3L2PVTMUT2U4UVEJL2V7 X-Mailman-Approved-At: Fri, 04 Dec 2026 19:55:54 +0100 CC: Lisanna Dettwyler , passt-dev@passt.top, raito@lix.systems, sergei@zimmerman.foo, Paul Holzinger 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 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)