patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Spectrum OS Development <devel@spectrum-os.org>
Cc: Alyssa Ross <hi@alyssa.is>, Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH] host/roots: Sandbox xdg-desktop-portal-spectrum-host
Date: Fri, 12 Dec 2025 19:00:57 -0500	[thread overview]
Message-ID: <20251212-sandbox-dbus-portal-v1-1-522705202482@gmail.com> (raw)

It is quite possible that these Landlock rules are unnecessarily
permissive, but all of the paths to which read and execute access is
granted are part of the root filesystem and therefore assumed to be
public knowledge.  Removing access from any of them would only increase
the risk of accidental breakage in the future, and would not provide any
security improvements.  seccomp *could* provide some improvements, but
the effort needed is too high for now.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
 .../template/data/service/xdg-desktop-portal-spectrum-host/run    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/xdg-desktop-portal-spectrum-host/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/xdg-desktop-portal-spectrum-host/run
index d2bf78cefc3837b5d5369dbab819606e71bf1fc5..c3d67b6520d490c71bdce0f1056b2960115108b3 100755
--- a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/xdg-desktop-portal-spectrum-host/run
+++ b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/xdg-desktop-portal-spectrum-host/run
@@ -12,4 +12,12 @@ s6-ipcserver-socketbinder -a 0700 /run/vm/by-id/${VM}/vsock_219
 if { fdmove 1 3 echo }
 fdclose 3
 
+unshare -inu --
+setpriv
+  --landlock-access fs
+  --landlock-rule path-beneath:read-file,execute:/nix/store
+  --landlock-rule path-beneath:read-file,execute:/usr/bin
+  --landlock-rule path-beneath:read-file,execute:/usr/lib
+  --landlock-rule path-beneath:read-file:/run/vm/by-id/${VM}/portal-bus
+  --
 xdg-desktop-portal-spectrum-host

---
base-commit: 59cda41acc455513cf9936e99b8d97647955ac07
change-id: 20251212-sandbox-dbus-portal-4f98ba29c23a

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


             reply	other threads:[~2025-12-13  0:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13  0:00 Demi Marie Obenour [this message]
2025-12-13 19:12 ` [PATCH] host/roots: Sandbox xdg-desktop-portal-spectrum-host Alyssa Ross
2025-12-13 21:21   ` Demi Marie Obenour
2025-12-13 21:42     ` Alyssa Ross
2025-12-14  0:22       ` Demi Marie Obenour
2025-12-14  0:28         ` Alyssa Ross
2025-12-14  1:39         ` Alyssa Ross
2025-12-14  4:49           ` Demi Marie Obenour
2025-12-14 10:52             ` Alyssa Ross
2025-12-14 19:50             ` Mickaël Salaün
2025-12-15  8:20               ` Günther Noack
2025-12-15  8:54                 ` Demi Marie Obenour
2025-12-15 11:27                   ` Mickaël Salaün

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251212-sandbox-dbus-portal-v1-1-522705202482@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).