From nobody Fri Jan 12 19:58:43 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 4TBXR75wnYz56Dgp; Fri, 12 Jan 2024 19:58:43 +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 4TBXR75TLrz4FNt; Fri, 12 Jan 2024 19:58:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705089523; 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=pVjN8xNGiCKAnh2UgZe6OoTi9fPS7bpBbQhL+LuF9Yc=; b=H4g0rNJUSdkl15MqtIz7IeSC466Y37FNX2iKbvsDt3Md/0BNjsVOwX5QBDcyTfrD717ZBc 7HCHif6wRfVVDB/wvWvYT7y/oGNLuRV4JByw/fTyFSsi2JODhIML8UyZpmO4A/u+yKu8mV f2muxfid5i4rz9dFk4z8HAMjDTT9yo57Lm3XcdkJCCSpF3VcF5lhn9n/aE12ozYE/Jp1qo XFFiruhbgEJR7XW+S1ZH6VvFsqChQJAhWELIdxxzYqK32PHOKvHoFWYlvsw7/6DsqGQhE2 VqABPUquCG/Al9c5UxK4+xE7Wi+KHG+YH+bkCcvbVxTggOzWvH8+9BVEm4R+Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705089523; 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=pVjN8xNGiCKAnh2UgZe6OoTi9fPS7bpBbQhL+LuF9Yc=; b=c0CspQ1q85+h+CFgCGHsOOY+R6qZKgKtCGuDKSaS2zVbQ3+Z/FLLHmlVbcyi6JcrXE5A0U +/fbK1lfLMQ0GyQoHjUWzWXqR7dF2g5l7ygUmKw0ufM3fHJz+Dg3udgIMSuX6xjfgPtdlt IvthXIEiWtx5Dg/3dA/mkEmBO24xOgKPpLuat6sYYz2O5LNpbZ6r1Du/Nd7G3QXn1JEOi2 elnjp543k0WhPsQ6fFwq+63EVwEdbIQS9EJI22XuVCJQKzy1sj/mVUnKxSDvG77MXlRQK+ WM7xkRYJO3ahTsAZvcrGv4C4Omdy4HRHu/4TnVgw+5p0wgMJJd4iDsUppSQ3og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705089523; a=rsa-sha256; cv=none; b=qcYrnObrC+Q2frqrx23aZ68+wR0tVLLYpqa86aOEIAWUdaEwmo9TOip854/Rjam1sOG6t5 IuXrThcP3xhAs+L3aDahkLBQGWbte34r6bq+Cs5eBxpSPu4JMRKzvlYxclxbW0tJ1JYnbk 1LHJ6o2ZHcxO3PBrjmvByct2ayPEEbLkLfYHD7GSu8rM7r2isZDRlsnP7ySS4X4Skx88G9 2cC7bMJHZOU0ZPpOCILB3CqWmhfoFXXTDqKVY5qJRqhbNk3XToy9FGYhSbzHD9QRsPFlEF nZA5WdJ93CZGIKd2ggsRYXofE+GCCwIhapGooMPPtO6QzQV+hvrPlaSCC7LwrA== 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 4TBXR74Y58z1FRH; Fri, 12 Jan 2024 19:58:43 +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 40CJwh6u002245; Fri, 12 Jan 2024 19:58:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CJwhlV002242; Fri, 12 Jan 2024 19:58:43 GMT (envelope-from git) Date: Fri, 12 Jan 2024 19:58:43 GMT Message-Id: <202401121958.40CJwhlV002242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 5df041c4bbf7 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 5df041c4bbf70d549b055f332630925295ad5aaf Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5df041c4bbf70d549b055f332630925295ad5aaf commit 5df041c4bbf70d549b055f332630925295ad5aaf Author: Kyle Evans AuthorDate: 2024-01-12 19:57:53 +0000 Commit: Kyle Evans CommitDate: 2024-01-12 19:58:16 +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 Differential Revision: https://reviews.freebsd.org/D43299 --- 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.