From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 139B61D187; Wed, 10 Dec 2025 10:55:40 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 9897E1D0E8; Wed, 10 Dec 2025 10:55:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) by atuin.qyliss.net (Postfix) with ESMTPS id F19EC1D0D9 for ; Wed, 10 Dec 2025 10:55:35 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id F0C7EEC0577 for ; Wed, 10 Dec 2025 05:55:33 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 10 Dec 2025 05:55:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1765364133; x= 1765450533; bh=Dk6VQ7uVFKqexiJ3qHIHl/pI7xdEUzI4fJTb7XEXqYQ=; b=X 333YZyAF3JghxCrDEEgfDkBT1AM06OS/eQ7KRppxlsQ90sE2keHixf5QKH5AaJAF 15LH+yL326fI0tukaTr14NYLt9O9KxrwvqF4+6uHuTug4TCRhhwYuwyOjhB00Zw/ 9gkpSubnAx/Di/UIVuZ9L4H+54RTLPDJQ7M0BQ0kS4jK4DmsMin5if+7+J5lQzcu kHQC0V0xCMwyDAZ8rzYzhpf8rxRMk3xFKryVLtvcmec2mprB7yNNLsCzu7hwxaY0 RcJ3Pz+dIPQXP3kvfuIhMUFA5Sai7jyTkvjT/pPgtDhrgWtN9cnd3INxAKHEUwBP 4roAS7DLXzIPQo6vgiwEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1765364133; x=1765450533; bh=Dk6VQ7uVFKqexiJ3qHIHl/pI7xdE UzI4fJTb7XEXqYQ=; b=AveCrXXYwdtbpVJNjUKnp4rD3cHLn00yOvjBoVnStkHw yvdaSCAE6Hf302ZA/QY/DUUFvdim3onr9cSd6T91iP4oVqxaG2swh2WKiaja1N0x VBcFzQMkSOfZHi+MPUOP0BJlnmu/NTL7Zv0iUEW3GSm09q16p8lIc6jpDVhHksOx ruM8W0woDxRYqgiVHS4NxZJKBA3kkHhtzGXXoFtBt2Y8XmlbCEsZ+7WyaS03FDC9 v9icV7rjj8RbEu+EbsJ+N0EUlL4SJRZHZ4BRChoBehE0CyOHltvJXEACjOVh9RRt UeEUBI7NHM4gRT+oN6s7GnqCKohD+j4kb+9Rogf7Ew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvvddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertd dtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeen ucggtffrrghtthgvrhhnpefgfedukedvleeileeludefveehgeelgfegvddujedvtdffue euveffheeljeekvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthhtohepuddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhruhhmqdhoshdrohhr gh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 10 Dec 2025 05:55:33 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id B8C6E6BCFD0C; Wed, 10 Dec 2025 11:55:17 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 2/2] host/rootfs: prevent VM ID reuse Date: Wed, 10 Dec 2025 11:55:15 +0100 Message-ID: <20251210105515.1033548-2-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251210105515.1033548-1-hi@alyssa.is> References: <20251210105515.1033548-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 7OF74EBQDRDDEHXKYQXMVQCKMRS2SNBE X-Message-ID-Hash: 7OF74EBQDRDDEHXKYQXMVQCKMRS2SNBE X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Since lsvm ignores empty directories, we can just leave them around to prevent mktemp -d from reusing the name. Fixes: b51a97f ("host/rootfs: add run-appimage program") Signed-off-by: Alyssa Ross --- host/rootfs/image/usr/bin/run-appimage | 7 ++++--- host/rootfs/image/usr/bin/run-flatpak | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/host/rootfs/image/usr/bin/run-appimage b/host/rootfs/image/usr/bin/run-appimage index d61a79c6..27c6e093 100755 --- a/host/rootfs/image/usr/bin/run-appimage +++ b/host/rootfs/image/usr/bin/run-appimage @@ -44,8 +44,9 @@ if { s6-instance-delete /run/service/vm-services $id } if { umount ${dir}/mount } # mount namespace if { umount ${dir}/mount } # private bind mount -# Atomically swap the VM directory with an empty one, which will be ignored by -# lsvm, then remove it, so we never have half a VM directory. +# Atomically replace the VM directory with an empty one, +# which will keep holding the ID so it's not reused, +# but be ignored by lsvm. if { mkdir /run/vm/by-id/.${id} } if { exch /run/vm/by-id/.${id} $dir } -background { rm -rf /run/vm/by-id/.${id} $dir } +background { rm -rf /run/vm/by-id/.${id} } diff --git a/host/rootfs/image/usr/bin/run-flatpak b/host/rootfs/image/usr/bin/run-flatpak index 6be21075..0cb236f4 100755 --- a/host/rootfs/image/usr/bin/run-flatpak +++ b/host/rootfs/image/usr/bin/run-flatpak @@ -46,8 +46,9 @@ if { s6-instance-delete -- /run/service/vm-services $id } if { umount ${dir}/mount } # mount namespace if { umount ${dir}/mount } # private bind mount -# Atomically swap the VM directory with an empty one, which will be ignored by -# lsvm, then remove it, so we never have half a VM directory. +# Atomically replace the VM directory with an empty one, +# which will keep holding the ID so it's not reused, +# but be ignored by lsvm. if { mkdir /run/vm/by-id/.${id} } if { exch /run/vm/by-id/.${id} $dir } -background { rm -rf /run/vm/by-id/.${id} $dir } +background { rm -rf /run/vm/by-id/.${id} } -- 2.51.0