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 4AB5B159D3; Tue, 09 Dec 2025 09:36:12 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id B9B13159B5; Tue, 09 Dec 2025 09:36:08 +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-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) by atuin.qyliss.net (Postfix) with ESMTPS id EA503159B4 for ; Tue, 09 Dec 2025 09:36:04 +0000 (UTC) Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9415314000C2; Tue, 9 Dec 2025 04:36:02 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Tue, 09 Dec 2025 04:36:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type: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=1765272962; x=1765359362; bh=M7/myGRjhJ LK5Z7Ez9AyiBAjRhwcEXvMC4gNx4jWiX4=; b=apbgvLPFPFTLC+PxFHyU8MzASk Qv0gum7b/ftRsIrhTKUh3WVkF9+rj81bMBDB5CrunRyoZa7ydGlYYyicK89L4U9k bvFCEksqeDN/HlGAZb4J9VvYqo1iINLxdr1Wd5MbdU7WW+dUqdDargkLDpDdXeNV 4COzdflP3crs6dOwUXjZOB1rKNK4F/ZanNP3eYAYUmRMa58BE7jQB8GFs5VHXk+T kcNxqncl19DWfIpHg2BarM8H+H+YrXRhSW8YL3U3x9+QjVMofrZOLnXEluSNbx02 MGUMSv3R0XBz1i0Eu/yS6fTgXnOYYQ+RJT9zXHp5ANdT9pGT0mTuRlMb1zmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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= 1765272962; x=1765359362; bh=M7/myGRjhJLK5Z7Ez9AyiBAjRhwcEXvMC4g Nx4jWiX4=; b=Xv/tOxck2ARhXoAjKBifpJ6c1s66/Zx9Xf+GNHuoidOcX6dqnZy KSXv9ScOn21T9aK2XbUkiXYILy/2yP4Vv3eDvh/Hg7p4kxoMi9dS6f3tgTzZ9gs5 UQHDDrPZcpI74GPv/G2p26TkdQD5tRmhDaJHUZnljAMhVO05GOCesXz/xKhhisDL isjf4tMKnFrK+ge0iIRLOQL1fE4rHTT9SydxwNz3JfIABBU8gyOkM5USkx7JfccP 1tkKBiM2Mk/hFqliwk1ZzIrgb7eObTZVbVefKAVq3MxDTJHGaoocyNui6pk/ajRR KZB8q5rwjiB/NGvB0spXKyBH7oyn3SMH/Rg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduledvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Dec 2025 04:36:02 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 168DE5F78B58; Tue, 09 Dec 2025 10:35:51 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH] host/rootfs: Sandbox Cloud Hypervisor In-Reply-To: <20251206-b4-sandbox-v1-1-253be8256649@gmail.com> References: <20251206-b4-sandbox-v1-1-253be8256649@gmail.com> Date: Tue, 09 Dec 2025 10:35:49 +0100 Message-ID: <87bjk8kney.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: TVF2FH3GNU753KNFZ2FGADTY3AJFLK7P X-Message-ID-Hash: TVF2FH3GNU753KNFZ2FGADTY3AJFLK7P 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: Spectrum OS Development 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: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > It only needs access to a small number of resources. Unfortunately, it > needs access to /dev/vfio right now. This should be fixed by using file > descriptor passing instead. Also, Cloud Hypervisor should not run as > root. > > Cloud Hypervisor needs to be able to lock memory. Running in a user > namespace prevents it from using CAP_IPC_LOCK. Therefore, it is > necessary to increase RLIMIT_MLOCK before running Cloud Hypervisor. > > Signed-off-by: Demi Marie Obenour > --- > host/rootfs/image/usr/bin/run-vmm | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) Looks good, but it seems to only work for VMs run as s6 services, not those run through run-appimage or run-flatpak. (I suppose the appimage integration test is somehow not thorough enough to catch this, which should be easier to fix once we understand the problem.) bwrap: execvp cloud-hypervisor: No such file or directory I suppose this is because etc/login sets PATH to /bin, and we don't share /bin with the sandbox. Changing that to /usr/bin would be a good idea I suppose, but would it also be a good idea to share /bin with the sandbox? What do you think? > diff --git a/host/rootfs/image/usr/bin/run-vmm b/host/rootfs/image/usr/bi= n/run-vmm > index ba8b59c2677408acdd01c2eda3cf2dd60992d881..24c3d607bfcf6fea6196b61d2= 941141486d33fd6 100755 > --- a/host/rootfs/image/usr/bin/run-vmm > +++ b/host/rootfs/image/usr/bin/run-vmm > @@ -52,5 +52,36 @@ unexport ! > fdmove -c 3 0 > redirfd -r 0 /dev/null >=20=20 > +s6-softlimit -H -l 18446744073709551615 > if { udevadm wait /dev/kvm } > -cloud-hypervisor --api-socket fd=3D3 > +bwrap > + --unshare-all > + --unshare-user > + --dev /dev > + --dev-bind /dev/kvm /dev/kvm > + --dev-bind /dev/vfio /dev/vfio > + --tmpfs /dev/shm > + --tmpfs /tmp > + --tmpfs /var/tmp > + --ro-bind /etc /etc > + --ro-bind /lib /lib > + --ro-bind /nix /nix > + --ro-bind /usr /usr > + --ro-bind /sys /sys > + --bind /run /run > + --proc /proc > + --ro-bind /proc/sys /proc/sys > + --tmpfs /proc/scsi > + --remount-ro /proc/scsi > + --tmpfs /proc/acpi > + --remount-ro /proc/acpi > + --tmpfs /proc/fs > + --remount-ro /proc/fs > + --tmpfs /proc/irq > + --remount-ro /proc/irq > + --ro-bind /dev/null /proc/timer_list > + --ro-bind /dev/null /proc/kcore > + --ro-bind /dev/null /proc/kallsyms > + --ro-bind /dev/null /proc/sysrq-trigger > + -- > + cloud-hypervisor --api-socket fd=3D3 > > --- > base-commit: 92e219e7c08c479d216a46d2736ea9d229ff034d > change-id: 20251206-b4-sandbox-9be7e5ed9926 > > --=20 > Sincerely, > Demi Marie Obenour (she/her/hers) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQGoGac7QfI+H5ZtFCZddwkt31pFQUCaTftdQAKCRCZddwkt31p FVMTAP0Yjban3oKvYF7wManSTF46IHrUfycD7z407/UqyotZJgD7BOsfW+L2QQ3W r2GvxnyfIsNuMj1XmVqLE0ppmI9rQgI= =pICj -----END PGP SIGNATURE----- --=-=-=--