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 89BBA23BA5; Thu, 11 Dec 2025 12:42:14 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id B21CE23B7D; Thu, 11 Dec 2025 12:42:11 +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 580C423B7B for ; Thu, 11 Dec 2025 12:42:10 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 0B2EBEC0566; Thu, 11 Dec 2025 07:42:08 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 11 Dec 2025 07:42:08 -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=1765456928; x=1765543328; bh=Ro1redBSo3 9u5H4R62EjShdYUSOT5LMnyn1xb1sB140=; b=fkeVaJivLKZe+yIBGybiEzSpKL V83JK8dM/YmXjJ5n2SldqzSRdTR2qReZYHVLs40fjPxo2byC3PhRQDszVMib/kbi B1BqLKjftvsbdNAXwDdO6Dz46pPWp/DJHLVVThrQpuRMWh3m3fCEC7MlboZRcKbX wSeTTNrYGKVYK9RYfwVha05rznV0vd9Te9LQXuJ3zmru2pFoYLoO76sTDuPaGCIL OJ/QYnmyIVo2v0xNNU7vlfbcXXC6FaMJmFU7c0WvSubu6IeQW9fZRlHKhzfF/OXJ PacauW4+BvOvtMPFUJLNjU9OrWJp9rI4KL28Kxv3N86eNt+K7v1wqXWj4NDQ== 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= 1765456928; x=1765543328; bh=Ro1redBSo39u5H4R62EjShdYUSOT5LMnyn1 xb1sB140=; b=RgzINETpl85r4l/5B/njcoaaJR8cYIdA+jGk4iycZv53H6sz6mY UYuBYyx76HbNRBmD3Q4r1vheKMwcBG63X5kIXT1NGWCMsByyhIUD+OXVptpgQnRK wBdZic1iadAC/zOAnKgKJKP6xquMxOVKDH3XRcGRLoq5nugNTa5xhljSpUQ+SY74 G6vC5QMTTD5DbcUZQD4/Do4tiTSuXZoUuQc862cxEER+IIg/S/JQpqKN0bbf6EX4 x9QXw17Wu5jr5iTfkm+SFdZ03F/lndzLvbUx13C9yJ47iycA8GZNdeKBk/sp3n8y iKKiJsU1eavHoih+lgdiV22xqKPmKbr4ZYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvheefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Dec 2025 07:42:07 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 8D5526E35D43; Thu, 11 Dec 2025 13:41:51 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 5/8] host/rootfs: create a per-VM user namespace In-Reply-To: References: <20251210124757.1080443-1-hi@alyssa.is> <20251210124757.1080443-5-hi@alyssa.is> Date: Thu, 11 Dec 2025 13:41:49 +0100 Message-ID: <87tsxx5gxe.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: A356QH7FBLRVVSB3XS7SX76W6QCK7QDL X-Message-ID-Hash: A356QH7FBLRVVSB3XS7SX76W6QCK7QDL 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: devel@spectrum-os.org 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: > On 12/10/25 07:47, Alyssa Ross wrote: >> The document portal has to be root to mount its fuse filesystem. This >> needs to be a shared namespace because virtiofsd needs to be in the >> same mount namespace as the document portal so that it sees the fuse >> filesystem, so we create a per-VM persistent user namespace. >>=20 >> Signed-off-by: Alyssa Ross > > (snip) > >> diff --git a/host/rootfs/image/usr/bin/run-appimage b/host/rootfs/image/= usr/bin/run-appimage >> index 47cab4c5..5e8e29fa 100755 >> --- a/host/rootfs/image/usr/bin/run-appimage >> +++ b/host/rootfs/image/usr/bin/run-appimage >> @@ -44,4 +44,6 @@ if { s6-instance-delete /run/service/vm-services $id } >>=20=20 >> if { umount ${dir}/mount } # mount namespace >> if { umount ${dir}/mount } # private bind mount >> +if { umount ${dir}/user } # user namespace >> +if { umount ${dir}/user } # private bind mount >> rm -r $dir /run/configs/${id} >> diff --git a/host/rootfs/image/usr/bin/run-flatpak b/host/rootfs/image/u= sr/bin/run-flatpak >> index bb366735..86ccc12a 100755 >> --- a/host/rootfs/image/usr/bin/run-flatpak >> +++ b/host/rootfs/image/usr/bin/run-flatpak >> @@ -46,4 +46,6 @@ if { s6-instance-delete -- /run/service/vm-services $i= d } >>=20=20 >> if { umount ${dir}/mount } # mount namespace >> if { umount ${dir}/mount } # private bind mount >> +if { umount ${dir}/user } # user namespace >> +if { umount ${dir}/user } # private bind mount >> rm -r $dir /run/configs/${id} > > Why is it necessary to unmount twice here? Because we mount twice, just like the comments say. It is a bit counterintuitive though. Namespaces can only be mounted onto a mountpoint that itself has private propagation. This is why we create a private bind mount at the start of create-vm-dependencies before unshare bind mounts the namespaces. You can also see this in an example in unshare(1). Perhaps it would be better and clearer to have /run/vm/by-id/${VM}/ns as a private mountpoint, with the nsfs files inside? That way, each of them only needs to be unmounted once, and then the ns directory also has to be unmounted once. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQGoGac7QfI+H5ZtFCZddwkt31pFQUCaTq8DQAKCRCZddwkt31p FfJ9AQC7Qqiap3n+gEJl08SFtE4blxoxdkfUqqnN+2GzkkBFRAD+NGnUojeHHE+y jsCSg2u8M0w8LBwFvpW0bF/SDvdoCAs= =F1Xb -----END PGP SIGNATURE----- --=-=-=--