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.133.124]) by passt.top (Postfix) with ESMTPS id C7D0E5A0265 for ; Wed, 28 Oct 2026 21:52:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793220777; 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=3Ww3AAvuJVLZoqAeDaKS7CD1/Hqd+UVWA/K7St/uS2M=; b=aKr7OYjkez2/fMgytqWui+VIu6wAC0YwC8CcYUikQjQQvVCOIfOW4t0Vanoo/dTxy+OEJV 6i8Z42YOs/0g9g/74TNnvboozxjtuZrEBx7j4hD1w1/uo7y+9Pa1h8O/DHw5UBRr8l+LMD svXX9WvT43QR63cbdqlA/88mLmwlF2w= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-118-KBGfuoUVOQKJ20NCefMnPA-1; Wed, 28 Oct 2026 16:52:50 -0400 X-MC-Unique: KBGfuoUVOQKJ20NCefMnPA-1 X-Mimecast-MFC-AGG-ID: KBGfuoUVOQKJ20NCefMnPA_1793220769 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48b01a74792so909747f8f.0 for ; Wed, 28 Oct 2026 13:52:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793220769; x=1793825569; 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=3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OsTVqBlM9NpZ36E9EGDwawJ sLWgb0D6Rl X-Received: by 2002:a05:6000:22ca:b0:48e:6145:498f with SMTP id ffacd0b85a97d-48e614549c7mr4316669f8f.55.1793220768829; Wed, 28 Oct 2026 13:52:48 -0700 (PDT) X-Received: by 2002:a05:6000:22ca:b0:48e:6145:498f with SMTP id ffacd0b85a97d-48e614549c7mr4316611f8f.55.1793220768196; Wed, 28 Oct 2026 13:52:48 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ebcb8d5sm31946517f8f.28.2026.10.28.13.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 13:52:47 -0700 (PDT) From: Stefano Brivio To: "Lawrence, Richard E" Subject: Re: [PATCH v2] pasta: Add --pass-fds option to skip closing file descriptors Message-ID: <20261028215246.1b3ff4bc@elisabeth> In-Reply-To: References: <20261022170823.868916-1-rlawrence@tamu.edu> <20261025130139.039cda1b@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: Wed, 28 Oct 2026 21:52:47 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 57h6-VY69pK5eJjwKzmeBkUuyHpI3hLL3JXnlgz4uU8_1793220769 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: KX4BYVU3VL3JEMMFPYEX5PH7BWXP5AIP X-Message-ID-Hash: KX4BYVU3VL3JEMMFPYEX5PH7BWXP5AIP 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: "passt-dev@passt.top" 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 Mon, 26 Oct 2026 16:19:41 +0000 "Lawrence, Richard E" wrote: > [...] > > I wanted to unconditionally relocate the fd_tap because I imagined > the following bug: imagine if someone is using pasta, passes the tap > on stdin, does NOT request to pass fds (tap | pasta -fd 0), and we > choose not to relocate the tap. Since stdin is never closed, the tap > would be passed to the spawned command on stdin, which would most > likely causing the spawned command to have unexpected behavior. Oh, you're right, I didn't consider that possibility. I thought that moving the tap file descriptor would only be relevant if we later close file descriptors, but that's not actually the case. I'll review your v3 in a bit. I just had a glance and I couldn't figure out right away why the second part of the change in isolate_fds() isn't a simple: if (!c->pasta_pass_fds) return; in the right place (after the --fd descriptor is moved, then), but I guess I'll figure it out. :) > Additionally, this choice is especially weird considering that the > hypothetical user did not even request the tap to be passed to the > spawned command at all. I would also like to point out that the code > already unconditionally relocates the tap: I assume that someone must > have foreseen some other bug (perhaps related to stdin in passt > mode?) and I don't want to cause a regression in another workflow > that I don't know anything about. Your assumption is correct, exactly that, see: https://bugs.passt.top/show_bug.cgi?id=215 https://github.com/libguestfs/libguestfs/issues/360#issuecomment-4939858744 as well as commits: c80d9db312df ("main: Ensure fds 0-2 are populated") fd5b0807f5d0 ("isolation: Move --fd descriptor to a number of our choosing") -- Stefano