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 2731917111; Tue, 09 Dec 2025 12:56:17 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 678AD1709D; Tue, 09 Dec 2025 12:56:14 +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-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) by atuin.qyliss.net (Postfix) with ESMTPS id 13B6B16FEC for ; Tue, 09 Dec 2025 12:56:13 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 671027A0096; Tue, 9 Dec 2025 07:56:10 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 09 Dec 2025 07:56:10 -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=1765284970; x= 1765371370; bh=Cc9C7jCUHZ75BxzAPBsxiAnnDSYFXQwHMkA0heB5PcA=; b=E kooM7chJ28mplL8BMT+HzsvRfmnatjep882+yTWlxH+TXxhSFCyYLGGYylx2f656 D78x5fIDoMTftJmv1L4st0WLZXG7qM9O5vcpI8SOnvcHvbpQQvO+gbkokI5HjJ4Y YreAhQxkVoLDGEXLW608Q5LnPy7pMni1O7arWZamH7s91Wsg9iXB5inlQQLOlkMI Tfid4UXi/0khYy7PivdESGNkAOtPRvFYRoOr6nCNcUSY1v7OMG67DRNAeDDXaXMl zfS3cpU/2fMZx3T95+4iHBqLjhQahFISE0jS2Z+U1+OrPR7DDyDTYyFLe6YnqSzg Nd1vpi0f7Eog5KchRyRmQ== 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=1765284970; x=1765371370; bh=C c9C7jCUHZ75BxzAPBsxiAnnDSYFXQwHMkA0heB5PcA=; b=yMWAE/t2bP6e28b0o p+/iD85Zmo5Z9wM+JaD9xyafgkpbZzWDsmiVKm/ffegpWLX8jioqjfuJj+v7jE8C T33uz/G1VjQ7m7IqsAAUHLH1RgvslJdrvjucJLua19DAWxbbB0e6A67+wO9i0IDc cxr3POyMxsgp+0BW/NeExDeNMVHwswi5YGEn9hXvl0tDP7m+78QRFc1BwaTFd++G 2sAKt4IU1aOKQDLIfYsth2yvMSVB2JbqNdaxg7MRbqBU4u6vxG4tShx4NqsXLQGw FlOPIhhP6Ko2Lc+89kkKvrItfcsnck0C1rQJ1yU2PwE1PuJySqBTCTclJ4fKrV2P GIjfQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduleeivdcutefuodetggdotefrod 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 07:56:09 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id E5054604E9FE; Tue, 09 Dec 2025 13:56:03 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v3 2/3] host/rootfs: put router app sockets in own dir Date: Tue, 9 Dec 2025 13:54:43 +0100 Message-ID: <20251209125442.719952-4-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251209125442.719952-2-hi@alyssa.is> References: <20251209125442.719952-2-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 2OOGNCJNNCFEQRBQUYGWJFDZPWGUOR7X X-Message-ID-Hash: 2OOGNCJNNCFEQRBQUYGWJFDZPWGUOR7X 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 --- v3: 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