From nobody Mon Jan 22 17:30:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TJcg31Qd7z57r8M; Mon, 22 Jan 2024 17:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TJcg26jYcz4fXK; Mon, 22 Jan 2024 17:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705944606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ih6srkR6ag6qkTyUmzkx20wPJV5ZBMLhXz8e2WfsMrw=; b=PRTOZpYYMpQ556ZD9c257w0EGRHcPyoIkBlZSzmL3Md2OE9lGpPyb5xYNE/AgIOpGpY3L+ prnZfn7pCAWBlZlrQo5LVjw6nUkoo3D1R6RF4chEdPwKAHozWl/eXF09AGKHbif0ExN0dE +SmvomWfpyUlz/wGy8ae8DdDDZEbTbO/H3q7xF8GPWU6Br7h78ywgVzlA1FlSJRAI49vtE Zef/l/PoGhXNxV4ryDPFHF50W6VRyX9OHs6bjxSMMltidMbb6TGbb5W/quYQ3ch8mW7cmZ c+s9fKKwSyrp87ddNDABbeGELGeXha9vYVZ12nACISCkJtSJj0q/dZVHDbXu2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705944606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ih6srkR6ag6qkTyUmzkx20wPJV5ZBMLhXz8e2WfsMrw=; b=ujeWCpOXELTMnV61bVqwdk0mDfsRF+Kh/DV9nKcAaEAAzki7YUsxnQ0gtOpifk6ssmqGgi UyYq4h0R6CEBWpqMErk1Fa4F2aBAofGEJk7GJ+JcW0HerC1Ft7Grs2HGZbCxbNOzrN8I90 R6nMf8+DMi2SAihxW5CmHB33fL1+z6bXdfenn89s15oifZWkLCR+dQJqaZbzSamsWA4wGh jmYvpr2HFDJYg0xFJxkwy0eFdmMWUfc1Gyirle6ge4jG5atsBDPy7PCqmyzJ9xiqUnsOlu 3FiqZXdEYN9NhRGrEocz+9ugvHCLIEYTYy/YfvVLno0R6vUQz008gaRY3nAVaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705944606; a=rsa-sha256; cv=none; b=b7Xf98oap7Er2RKMSxo+XfJ1LHzwUkpL/V9FOZk5cCGTV83qh2LQOwRUDQdQsUFm/76CSp 4swQYLGnA4ujn6H11TZk822g/IcjwAcNTmOsx+bw4wRxnfSKahwF7n1ZsipU73giUPRfkE fiMyA4Z9xUusxKM8+ZD/T58S6E2huY7lEzPiLx7E6VFqs+YUSoTbWCcRFuDYQPlP1FoS+D 4btkcQNFHd9tXOqjcYSEYEOdkBpbia7xK60+ONFmmcTnWCFv1li9fTqASspGICvFjKpacV /ya522NhY8g6he+xyC6S5nx8hp7QXewdxcn8Jx40nS97wE/N1ddbkUWJhg3Hsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TJcg25pt0z19PV; Mon, 22 Jan 2024 17:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40MHU6ok009643; Mon, 22 Jan 2024 17:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40MHU6n8009639; Mon, 22 Jan 2024 17:30:06 GMT (envelope-from git) Date: Mon, 22 Jan 2024 17:30:06 GMT Message-Id: <202401221730.40MHU6n8009639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: dee3902d1eda - stable/14 - bhyveload(8): document some SECURITY CONSIDERATIONS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dee3902d1edac299d2258b007f245dd91d43d02c Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=dee3902d1edac299d2258b007f245dd91d43d02c commit dee3902d1edac299d2258b007f245dd91d43d02c Author: Kyle Evans AuthorDate: 2024-01-12 19:57:53 +0000 Commit: Kyle Evans CommitDate: 2024-01-22 17:19:18 +0000 bhyveload(8): document some SECURITY CONSIDERATIONS The situation is improved now that we're running in a sandbox, but there is still some host machine access that could be concerning depending on the context. These concerns may be somewhat mitigated by the fact that the host machine usually provides the loader binary, even when the guest image is providing the loader scripts -- they only bring the lua scripts, and they have to be able to execute arbitrary syscalls rather than the interfaces provided by libsa(3). Reviewed by: jhb, markj (cherry picked from commit 5df041c4bbf70d549b055f332630925295ad5aaf) --- usr.sbin/bhyveload/bhyveload.8 | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyveload/bhyveload.8 b/usr.sbin/bhyveload/bhyveload.8 index edeb8ee938f4..54e326e49c8c 100644 --- a/usr.sbin/bhyveload/bhyveload.8 +++ b/usr.sbin/bhyveload/bhyveload.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 24, 2016 +.Dd January 12, 2024 .Dt BHYVELOAD 8 .Os .Sh NAME @@ -171,3 +171,43 @@ at NetApp Inc with a lot of help from can only load .Fx as a guest. +.Sh SECURITY CONSIDERATIONS +Note that in some configurations, +.Nm +will execute guest loader scripts in the context of the host machine. +Note, however, that +.Nm +will enter a +.Xr capsicum 4 +sandbox before it loads the +.Ar os-loader +or executes any loader scripts. +On the host filesystem, the sandbox will only have access to the path specified +by the +.Fl h +flag, the contents of the +.Pa /boot +directory if +.Fl l +was not specified, and the chosen console device. +.Pp +Note that the guest loader scripts are already subject to some limitations that +are not relaxed simply because we are running in userland. +For instance, any I/O on the loader's +.Dq host +device that can be done in loader scripts is limited to the interface that +.Nm +provides, which itself will restrict paths that can be touched to those within +a specified +.Fl h +directory, if any. +Access to files within +.Pa /boot +inside the sandbox would require arbitrary code execution in userboot, and +userboot is usually provided by the host machine rather than anything that is +a part of the guest image. +All access to the +.Fl h +directory as well as +.Pa /boot +is strictly read-only in the sandbox.