From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com 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 763E15A026E for ; Tue, 24 Nov 2026 22:32:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795555957; 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=oSFOwR6jRAxkg9NL9FlfiSkQGP5FTNKFEDrBanqycsc=; b=ZrI0ne1mQ/jyeaZmJCkgCMdHOv91UIAP2zb3YadztMwucX3ZScp/6tUumVKYTV7TJGBYVb jDcGIumBJKpsmuyQKlQEDSpx67u4IDKgH2gpGubi+LiPO3nLXn3oXAlYumX9ybufB+uSIW cVnVi+f4U7GF+jjRswx7lRvdABvbYfE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-63-XcSgfqXvPDa8NsQiu5Fh0g-1; Tue, 24 Nov 2026 21:32:35 +0000 X-MC-Unique: XcSgfqXvPDa8NsQiu5Fh0g-1 X-Mimecast-MFC-AGG-ID: XcSgfqXvPDa8NsQiu5Fh0g_1795555954 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-49090fde23aso3075140f8f.2 for ; Tue, 24 Nov 2026 13:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795555954; x=1796160754; h=date:content-transfer-encoding:content-type: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:content-type; bh=7kk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NkUk2ZIrB+ccLfi/MR5KYsDsKydOebD2sFAdYUSB+HT6XZ+xADGi/F9Ifru0SdPMokto= X-Received: by 2002:a05:6000:4541:b0:4a6:b87:d7a1 with SMTP id ffacd0b85a97d-4abb4b85b88mr22288636f8f.49.1795555954005; Tue, 24 Nov 2026 13:32:34 -0800 (PST) X-Received: by 2002:a05:6000:4541:b0:4a6:b87:d7a1 with SMTP id ffacd0b85a97d-4abb4b85b88mr22288596f8f.49.1795555953376; Tue, 24 Nov 2026 13:32:33 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b110ba3sm24758831f8f.35.2026.11.24.13.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2026 13:32:32 -0800 (PST) From: Stefano Brivio To: Sergei Zimmerman Subject: Re: pasta: patches for --pass-fds (fix) and --ready-fd (new) Message-ID: <20261124223231.0d9c94a0@elisabeth> In-Reply-To: References: <20261124192024.0e16f855@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Tue, 24 Nov 2026 22:32:32 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AJzI3qYgijfDrm7l6Lgi5h3DfS0wpiUwJy43jHuYFKU_1795555954 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZM6SPB23AIKP4MXABGIWAG3ZYIDTWOB2 X-Message-ID-Hash: ZM6SPB23AIKP4MXABGIWAG3ZYIDTWOB2 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: Lisanna Dettwyler , passt-dev@passt.top, pennae@lix.systems, raito@lix.systems 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 Tue, 24 Nov 2026 18:46:29 +0000 Sergei Zimmerman wrote: > > and at that point it looked like you could just let pasta do its job = =20 > > and daemonise itself >=20 > Forgive me if I=E2=80=99m slightly incorrect on the details, but here=E2= =80=99s the > simplification that can be done in the lix build launcher: > https://gerrit.lix.systems/c/lix/+/6897 Sure, I understand that's a significant simplification. It's the same as what we discussed back in June, though. I'm just suggesting that you can get the same simplification by letting pasta do its course, that is, drop the '--foreground' option, and it will behave like all regular UNIX daemons do: it forks to background once it's ready, and not a moment before: https://archives.passt.top/passt-dev/cbe5ab63-3266-4234-8745-5a6583039809= @redhat.com/ https://archives.passt.top/passt-dev/20260527213924.2586bca5@elisabeth/ No reason for a side channel just because slirp4netns had it. And yes, Podman used to do that too, but eventually I convinced them to fix that. :) When you're done with the namespace, you don't need to track pasta at all: just remove the namespace handle, and pasta goes away. I saw the "We don't let it daemonize itself for process managements reasons" comment, it was the same in June, but when Lisanna checked it appeared to be a left-over. Or at least we couldn't figure out what those particular "process managements reason" were. If you want something explicit for corner cases, though: > There=E2=80=99s several arguments I see for the ready pipe: >=20 > * Asynchronous waiting for the child exit is painful without pidfd. > This seems relevant for lix. ...we discussed providing a pidfd for some particular use cases in Podman as well. All pasta can do (on top of automatic exit) is to write a PID file, but it's racy, strictly speaking. If that solves a problem for Lix as well, let's implement that instead. This --ready-fd option scares me enough (both in terms of letting something "wrong" slip in now, as well as hours of fun with AppArmor / SELinux once others start using it) that I'd rather be inclined in investing a bit of time in the pidfd thing myself. Of course, I don't want to force that option if it's really not suitable for your purposes... but perhaps it is? > * The setup completion is waited upon in another child process of lix > while the parent that spawned pasta goes off on its merry way, so I=E2= =80=99m > not even sure you *could* wait for the daemonization to complete in > this process setup? Just fork(), exec(), and wait for the child to exit before proceeding, instead of keeping a separate child process around implementing more specific synchronisation. Even with a file descriptor indicating readiness, you would need to wait anyway, right? > I=E2=80=99d need to brush up on pidfd polling and whether > it can work around wait4 limiting you to child processes. I think you could still use wait4() or similar. > As for the other commit, fd inheritance seems like a useful > simplification. Closing leaked FDs is the parent=E2=80=99s responsibility= that > cppnix and lix* already handle so whatever is inherited is done > intentionally. Until you forget to do that, and then it's our responsibility. :) And even if it's not, it risks getting catastrophically bad. I mean, if people want to run Bubblewrap *inside* pasta, ouch... but fine, there I understand the need to pass file descriptors down to the spawned command. But if you don't need to let pasta spawn any command, if the only purpose is to pass a network namespace without using a filesystem path, then give pasta your PID? Wouldn't that work? If, for some reason I'm missing, you really need to pass the namespace as file descriptor, I'd rather implement that as a special option that only applies to network namespaces and nothing else, and keep closing any (otherwise) leaked file descriptor. I really would like to avoid the risk of having anything unnecessary and potentially dangerous in pasta's descriptor table, *if possible*. --=20 Stefano