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 89CE9165D4; Tue, 09 Dec 2025 11:06:34 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 1899F16549; Tue, 09 Dec 2025 11:06:31 +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 fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) by atuin.qyliss.net (Postfix) with ESMTPS id 85C4216548 for ; Tue, 09 Dec 2025 11:06:30 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 863161400135; Tue, 9 Dec 2025 06:06:28 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 09 Dec 2025 06:06:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :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=1765278388; x= 1765364788; bh=WcMfsP7B456rZLKOuSv8rYYVFJiy1QA393bgoYMZZuM=; b=H tdS9tDrVRAvFmwt085BijzDv2Rkr27UeQN3LjMOPwyKZoESlDi5mIrFoIpK1xXo3 HK4Z0sArEH0+BuE4PFhbXZRO14jkzXPRMzN/lkf/AQzTIboXd93OfkXHSSa1MMTH v2IuhC/bFoimHmeQmPkD5O8J+VmEXC+HKAe7b4pet4rnbmUsIr0l+QeN7oBJOrdz x4wkNfclia1ZP7DmB2GSoF+KsfgyWJIHSxKlr4E9eRS+vxwFdd0SOAa85fpP5m/Z wrbBgdPRCivmTxpHUo2vNijnz0R0YFUbifC8kyehtgGlzbVlbs0I+qUthY9jyxDG zX0oJmYjzl1Po7KXsCovA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1765278388; x=1765364788; bh=W cMfsP7B456rZLKOuSv8rYYVFJiy1QA393bgoYMZZuM=; b=F+vJHV7ivE/VqEx8N CwzNHLrLaj++FAY3oBdEQeSiXr5LU+OhEnU/Nli3mg8xp+VP8taKXe+dfDqZwiL5 1+uveDVK1vtAJ5BPvNi5r6wKZLCBYmrC78QeZMeH7Th8pzKSdKEDwngev5smdo9F G3BwyLjZ6Xq9bAVYoWbz/gQmRKPdZlmsOiAE3K/XMYAJvK+hytDH8PAIjd6E1FBU bXlsE1kSAMrsm2FnXjDVkWe+4E3zKRb5nss74lJCaxsC4sOQ2FiV0MsPZbTqEGYk HKLUbtzid8pwuzAf8a1zM4a7M6l1QGuwcLbM0Bwp3ACkPsdF4u/iBLM5u82udsXl 1r+gg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduleegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeegueeiud eukeekiedvteffgeekudfhudevvdelvdekhfefieetkeduudejffefgeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrd hishdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep hihurhgvkhgrsegthigsvghrtghhrghoshdruggvvhdprhgtphhtthhopeguvghmihhosg gvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhr uhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Dec 2025 06:06:28 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 312105FCEB46; Tue, 09 Dec 2025 12:06:22 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v2 2/3] host/rootfs: put router app sockets in own dir Date: Tue, 9 Dec 2025 12:05:04 +0100 Message-ID: <20251209110503.674499-4-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251209110503.674499-2-hi@alyssa.is> References: <20251209110503.674499-2-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: XFF5MJYH5IXXGBPNYLNHDZQOTKUDNYPX X-Message-ID-Hash: XFF5MJYH5IXXGBPNYLNHDZQOTKUDNYPX 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 CC: Yureka Lilian , Demi Marie Obenour 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: When we have different Cloud Hypervisor instances running as different users, it makes sense not to permit them to see into each other's /run/vm directories. That means we'll need somewhere else to store router app sockets, which should be accessible by VMs other than the driver VM associated with the router. Signed-off-by: Alyssa Ross Message-ID: <20251209003813.553461-2-hi@alyssa.is> --- v2: no change host/rootfs/Makefile | 1 + .../template/data/service/spectrum-router/run | 2 +- tools/start-vmm/lib.rs | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile index 7bec1259..831fdc10 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -14,6 +14,7 @@ DIRS = \ dev \ etc/s6-linux-init/env \ etc/s6-linux-init/run-image/configs \ + etc/s6-linux-init/run-image/router \ etc/s6-linux-init/run-image/sd-notify-wrapper \ etc/s6-linux-init/run-image/service/serial-getty/instance \ etc/s6-linux-init/run-image/service/serial-getty/instances \ diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run index dc1ef900..ec26b76f 100755 --- a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run +++ b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run @@ -8,7 +8,7 @@ importas -i VM VM s6-ipcserver-socketbinder -a 0770 /run/vm/by-id/${VM}/router-driver.sock fdmove -c 3 0 -s6-ipcserver-socketbinder -a 0770 /run/vm/by-id/${VM}/router-app.sock +s6-ipcserver-socketbinder -a 0770 /run/router/${VM} fdmove -c 4 0 # Notify readiness. diff --git a/tools/start-vmm/lib.rs b/tools/start-vmm/lib.rs index b44e0375..2ee87bd9 100644 --- a/tools/start-vmm/lib.rs +++ b/tools/start-vmm/lib.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: EUPL-1.2+ -// SPDX-FileCopyrightText: 2022-2024 Alyssa Ross +// SPDX-FileCopyrightText: 2022-2025 Alyssa Ross // SPDX-FileCopyrightText: 2025 Yureka Lilian mod ch; @@ -117,6 +117,16 @@ pub fn vm_config(vm_dir: &Path) -> Result { )); } + let provider_path = Path::new("/run/vm/by-name").join(&provider_name); + let provider_target = provider_path + .read_link() + .map_err(|e| format!("dereferencing {provider_path:?}: {e}"))?; + let provider_id = provider_target + .file_name() + .ok_or_else(|| format!("{provider_path:?} target has no file name"))? + .to_str() + .ok_or_else(|| format!("{provider_target:?} has non-UTF-8 basename"))?; + let mut hasher = std::hash::DefaultHasher::new(); vm_name.hash(&mut hasher); let id_hashed = hasher.finish(); @@ -132,7 +142,7 @@ pub fn vm_config(vm_dir: &Path) -> Result { Ok(NetConfig { vhost_user: true, - vhost_socket: format!("/run/vm/by-name/{provider_name}/router-app.sock"), + vhost_socket: format!("/run/router/{provider_id}"), id: provider_name, mac, }) -- 2.51.0