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 EA5D91368D; Thu, 04 Dec 2025 02:21:50 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id D2ABA135E9; Thu, 04 Dec 2025 02:21:48 +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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-yx1-xb131.google.com (mail-yx1-xb131.google.com [IPv6:2607:f8b0:4864:20::b131]) by atuin.qyliss.net (Postfix) with ESMTPS id 26D05135E7 for ; Thu, 04 Dec 2025 02:21:48 +0000 (UTC) Received: by mail-yx1-xb131.google.com with SMTP id 956f58d0204a3-6430834244aso284105d50.2 for ; Wed, 03 Dec 2025 18:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764814905; x=1765419705; darn=spectrum-os.org; h=cc:to:references:in-reply-to:content-transfer-encoding:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to; bh=MJmalGy2HhTBV+Tfe8EDCqg/he7siYCWW+0IEaOchY4=; b=X949NA6V+zdfAlc3Q0EAYxlZ+YQUSkAalQ8nHcQjCoceEoJ2oiMtm7CZrzECh4eYHA 339OkOkupUN6FCGlNn7ZXjwu5XA5IcrcvEUNk9zA6TsVxOhXzHlA98DFULO+N14GL/IY lBsQrTd7j7bXYfIitUWcM/lfzAPg269q/S84ZuNMYpTzuFzeHLGwJ0rV7IYUIRVm4MOx fNFXuhA58ksLRmzR1pXCssZ+fQN0EO73agQ0AuqcS0D6b9zOhu4mrrxV4Jn0hepZizX0 jI7MK23LYalXRiBXfSenDhwSnnKo05By9UbGjoDiO7XhRfYJ/pUoM3hvoHhLvhWt/bku /Oug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764814905; x=1765419705; h=cc:to:references:in-reply-to:content-transfer-encoding:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MJmalGy2HhTBV+Tfe8EDCqg/he7siYCWW+0IEaOchY4=; b=N87SC+4g80G5NFyDLYKBQvbRsNXdaq9gk0NHBeQfnk7B3DrrPc9Oi5so+WM7HPdUEq RC8v32S7jWXL4Icgt5QfbG7/sBAcLW8Uuick1UkkdCnJnSb6QwhL9aSRmLjsz3+QCN6N ipD0w5bh9cAT5Ih0wcFuXfz/pfhfycCaJorrXrS5Sla05kmRKWqpOq74osB2I+ovdmfY K57F1tXvpcow2RCG2ojgahTD1jxX+1CkmcaitGiD6N3U5NnnVv4+2L7gcUfwhkqWeCGc sx+FWRwP4f7lL7dHVnZbpeOrzty+vCROrlCHaFfJfwQVnxMIx9zuswZg7BB8Su/v8H5J WmzA== X-Gm-Message-State: AOJu0Yy1cWzxTZyz8rDRxnLKaAxn8cvrJz/i45taqnhNyr+RGRnNCNNE cU8MVCK9Zjd42dTtj+f4a64R5N355Qjx2K9ADcPoj/NQM9Crdui181FgR8HcqQ== X-Gm-Gg: ASbGncsjxclWSL5+uYn/mgA79zLOxuV9RDtR+D03DxMYzNBto+AjlmBZMoJsxo6dFn5 TJIoQzbSUiIX+RDs9jjrDYHsLptlJo6oxG7lVczXbqs+ETXqX8L54LtbW+agUqiPMqZ4DreSymi KMJSiYGtKJ/okXw91KdAXd5DHKLSrL+VyF3T/ImCzsgRYPALhqiJU/42fbHcSpa0BIqbzl9kMol A+Jj5BaKVFUKTNY/f04cy3MsQ743Vg34uEQowSIzri72yGRKJV/OrfqMQMj0QwQowI/zEEWi/G9 V/iQKB0VBaBOL73fNj4VVV5fnzyoHE/hpUX7syiexREkcKC3h7cdEuuFYW4PgzYViMh5rKUnRxH FE9KKfApOU/gOW4KloAIhNsdJtebPnGHB45673dnu8a+alvCz0RLKqCy3e+tWlgHTEres0dzYDa R3CpP5BugWKuLYmt2oN7kF90GZGHvcUhyIdQZrUQm+1h8iZ5VUjBXroD9d8C/AmgG7e1BXz+L1O 1DJ/3/4D+ZLauCDHq6gqrsF5w1runimPRs= X-Google-Smtp-Source: AGHT+IF1TMFXXA/VBAC9O6tkPSsoarSHnW2RAcBX/pFGT1QqGrt/RYUe/SXfzis8WTufwmNneGPiwg== X-Received: by 2002:a05:690e:4282:20b0:63f:b5d8:9da3 with SMTP id 956f58d0204a3-6443d8fac04mr1014133d50.22.1764814905018; Wed, 03 Dec 2025 18:21:45 -0800 (PST) Received: from localhost.localdomain (h96-60-249-169.cncrtn.broadband.dynamic.tds.net. [96.60.249.169]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-78c1b4caabcsm947257b3.14.2025.12.03.18.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 18:21:43 -0800 (PST) From: Demi Marie Obenour Subject: [PATCH v4 0/6] Partially sandbox Cloud Hypervisor, crosvm, virtiofsd, and the router Date: Wed, 03 Dec 2025 21:20:37 -0500 Message-Id: <20251203-sandbox-v4-0-71542a7dcf5c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAPXvMGkC/2XMTQ6DIBCG4asY1qWB4Selq96j6WIQVJKqDTTEx nj3ohtNu/xgnncmycfgE7lWM4k+hxTGoQx5qkjd4dB6GlzZBBgozsHQhIOz40QVSkCNkltlSLl +Rd+EaSvdH2V3Ib3H+NnCma+v/43MKafaoTWgFZNO3Noew/Ncjz1ZGxl2B4zvDiijppFeXUBBD fbXiaMTuxPFNVyjZxrLnz+6ZVm+JgMd3Q4BAAA= X-Change-ID: 20251129-sandbox-5a42a6a41b59 In-Reply-To: <20251203-sandbox-v3-0-f16ae06a251e@gmail.com> References: <20251203-sandbox-v3-0-f16ae06a251e@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1764814837; l=2220; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=MRDTSDw5Bs+/XlDOEwp+Knif/I1iGzC0uKkTdDoP3J8=; b=WbdnZOvuJatsiiP5/SwVerFkENt5sd+922TAhiKib9UGwNhAZognxuc572HhGDHGq/Qxd0Ppi eKUh1XZW8srDpDIbWAqPymQS7XE7EcDp+5HOr0ToER2al5U9q88YjDj X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: TUFZRLR3EKPTLCIZ2BGMTFF5OVEALR6T X-Message-ID-Hash: TUFZRLR3EKPTLCIZ2BGMTFF5OVEALR6T X-MailFrom: demiobenour@gmail.com 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: Demi Marie Obenour , Alyssa Ross 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: This restricts the access of these programs to the system. Seccomp is not enabled, though, and the processes still run as root. Full sandboxing needs additional work. In particular, Cloud Hypervisor should receive access to VFIO devices via file descriptor passing. D-Bus, the portals, and Weston only unshare cgroup, IPC, network, and UTS namespaces. Unsharing mount namespaces breaks the file portal. Signed-off-by: Demi Marie Obenour --- Changes in v4: - Unshare cgroup, IPC, network, and UTS namespaces from Weston. - Unshare cgroup and UTS namespaces from D-Bus. - Link to v3: https://spectrum-os.org/lists/archives/spectrum-devel/20251203-sandbox-v3-0-f16ae06a251e@gmail.com Changes in v3: - Protect bus daemon and portal from other services. - Use s6-softlimit instead of sh to set hard RLIMIT_MEMLOCK. - Link to v2: https://spectrum-os.org/lists/archives/spectrum-devel/20251201-sandbox-v2-0-9f4e58252c2b@gmail.com Changes in v2: - Sandbox Cloud Hypervisor, virtiofsd, and the router - Link to v1: https://spectrum-os.org/lists/archives/spectrum-devel/20251129-sandbox-v1-1-6dab926504d3@gmail.com --- Demi Marie Obenour (6): host/rootfs: Sandbox crosvm host/rootfs: Sandbox router host/rootfs: Unshare a few more namespaces in virtiofsd host/rootfs: Sandbox Cloud Hypervisor host/rootfs: Try to protect the portal and dbus daemon host/rootfs: "Sandbox" Weston host/rootfs/default.nix | 4 +-- .../vm-services/template/data/service/dbus/run | 5 ++++ .../template/data/service/spectrum-router/run | 19 +++++++++++-- .../template/data/service/vhost-user-fs/run | 2 +- .../template/data/service/vhost-user-gpu/run | 29 +++++++++++++++++++ host/rootfs/image/etc/s6-rc/weston/run | 5 ++++ .../image/etc/udev/rules.d/99-spectrum.rules | 3 ++ host/rootfs/image/usr/bin/run-vmm | 33 +++++++++++++++++++++- 8 files changed, 93 insertions(+), 7 deletions(-) --- base-commit: de3a8808f390bdce421077a62107f1d8bdeff22c change-id: 20251129-sandbox-5a42a6a41b59 -- Sincerely, Demi Marie Obenour (she/her/hers)