From nobody Tue Jul 22 20:30:59 2025 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 4bmpnH72HWz5q76V; Tue, 22 Jul 2025 20:30:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bmpnH4jMjz3Cbr; Tue, 22 Jul 2025 20:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753216259; 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=NfI9jHVSrRyLNqQqjBrFf0HFf/B9r7RZRlCRl2u0UG0=; b=he9MeocO8lYQq7Y3CBv58jE8qUXJrnQnfdOvnqnCbp6yIOjRr+ul5esPV+JbdXyASg+VXy xasTQAkHV3LXDHeR0vegcpDRMuLKorvv+fMykxLu9UkfDH3VIizbfZSHN4f93jzRdXBNC/ g3J+30d87aC3R1wKVvr7u98bWpxkNLZoScxZgK36LzyxQoa7m3sJmpJ4z1CIRXAasDLKno e+NAQpt+sYxx4l+Rxp62A/T6pHbJviDtOvTRW55o444cidTGdL8BYFa/c0vJ18SxMBdCKq bkWthaipKXVA7e4yUbLNnr5tA7f3VW/7Ctxeaj7j5jn8hrepIR2Y+wEWbzmivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753216259; 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=NfI9jHVSrRyLNqQqjBrFf0HFf/B9r7RZRlCRl2u0UG0=; b=rsguf8u19DSK6ypswddgYEEvd1Bn43FzAomGPq3vaOmDL/Uz2MVQyoKhTxIbH/K9cA4tyT HDfLMA7P4qo0VvmajEVG4Ba92I2KsFzZk0Du+rcECzztoxwwrSiKi4CojXoSOk07pxPz8q gO9/wbsck0YePYaTTDqwVa4sW9M3Zb+QqusJYqR4Wkk3a77kOm2bVADC3flrHHMl7Cr99J OxckYLb4wQZtn2CTUnp558ZR1rdBOS3/bWNuGvqkWTu61e2pKrOAZrbNbrPkSS+aDQ2rKo tCTDLIjrJ4q+WTqNT6ux7ao0FedScVah6ppwyopEaprFPN/CkZTndkb/Jw/R1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753216259; a=rsa-sha256; cv=none; b=Mwjar0hZRpAfiz71wSI51OAkWxRw/ybk9G1clYF+gJ48G131aUAH28aDxKpXxDO3oMAnQI u1yBLUsnE+aahYNr0fT7b5bqVK/fRTnMqHH7AbySD5qv4SXGz+wkkUMaoFZOtB0OxRACUY sxlvOQhsT0D4qs+kK8gbWQSSA3QDG7Y8d91sDEbi30+H0CAFB0EVxcywI6oXmgu64//Mzv 44MSWrrmafaTHetSyNoA34YHklL+BRd7bqjYeh+lUoCeA5fIt2892XdjbPgsR+Fsb/4MUC EQ8cXqHRyKl/S5eNyvFdtQ3IH3w9IhIeCTi8xKNUbez7xxYq8C/SGyW2lf8mxw== 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 4bmpnH4Js0zjqH; Tue, 22 Jul 2025 20:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56MKUx1C000264; Tue, 22 Jul 2025 20:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56MKUxq0000261; Tue, 22 Jul 2025 20:30:59 GMT (envelope-from git) Date: Tue, 22 Jul 2025 20:30:59 GMT Message-Id: <202507222030.56MKUxq0000261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ce1af6eb54a4 - stable/14 - capsicum.4: Add some more detail from the Capsicum paper 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce1af6eb54a423af66054e3775bc71bb09c96b41 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ce1af6eb54a423af66054e3775bc71bb09c96b41 commit ce1af6eb54a423af66054e3775bc71bb09c96b41 Author: Ed Maste AuthorDate: 2025-06-14 17:57:33 +0000 Commit: Ed Maste CommitDate: 2025-07-22 20:30:30 +0000 capsicum.4: Add some more detail from the Capsicum paper Adapt some language from "Capsicum: practical capabilities for UNIX" https://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-security-capsicum-website.pdf Reviewed by: markj Discussed with: rwatson Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50855 (cherry picked from commit c54534e60263954fac4db5ebb041ed4597df1195) (cherry picked from commit ce65ff203a4f7ce59c8782f87d90a657f7ccbc46) --- share/man/man4/capsicum.4 | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/share/man/man4/capsicum.4 b/share/man/man4/capsicum.4 index 6aefae9d6df2..1de8e4531f4f 100644 --- a/share/man/man4/capsicum.4 +++ b/share/man/man4/capsicum.4 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 5, 2025 +.Dd June 17, 2025 .Dt CAPSICUM 4 .Os .Sh NAME @@ -37,6 +37,12 @@ .Nm is a lightweight OS capability and sandbox framework implementing a hybrid capability system model. +.Nm +is designed to blend capabilities with UNIX. +This approach achieves many of the benefits of least-privilege operation, while +preserving existing UNIX APIs and performance, and presents application authors +with an adoption path for capability-oriented design. +.Pp Capabilities are unforgeable tokens of authority that can be delegated and must be presented to perform an action. .Nm @@ -59,6 +65,34 @@ namespaces) is restricted; only explicitly delegated rights, referenced by memory mappings or file descriptors, may be used. Once set, the flag is inherited by future children processes, and may not be cleared. +.Pp +Access to system calls in capability mode is restricted: some system calls +requiring global namespace access are unavailable, while others are +constrained. +For instance, +.Xr sysctl 2 +can be used to query process-local information such as address space layout, +but also to monitor a system’s network connections. +.Xr sysctl 2 +is constrained by explicitly marking \(~~60 of over 15000 parameters as permitted +in capability mode; all others are denied. +.Pp +The system calls which require constraints are +.Xr sysctl 2 , +.Xr shm_open 2 +.Pq which is permitted to create anonymous memory objects but not named ones +and the +.Xr openat 2 +family of system calls. +The +.Xr openat 2 +calls already accept a file descriptor argument as the directory to perform the +.Xr open 2 , +.Xr rename 2 , +etc. relative to; in capability mode the +.Xr openat 2 +family of system calls are constrained so that they can only operate on +objects “under” the provided file descriptor. .It capabilities Limit operations that can be called on file descriptors. For example, a file descriptor returned by @@ -152,3 +186,14 @@ and .An Kris Kennaway Aq Mt kris@FreeBSD.org at Google, Inc., and .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net . +Portions of this manual page are drawn from +.Rs +.%A Robert N. M. Watson +.%A Jonathan Anderson +.%A Ben Laurie +.%A Kris Kennaway +.%T Capsicum: practical capabilities for UNIX +.%J USENIX Security Symposium +.%D August 2010 +.%O DOI: 10.5555/1929820.1929824 +.Re