From nobody Fri Mar 24 06:40:14 2023 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 4PjXdV5B8Kz418nP; Fri, 24 Mar 2023 06:40:14 +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 4PjXdV4YlLz4Brh; Fri, 24 Mar 2023 06:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679640014; 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=qGezSdg3Ntmew6q3uZ99fkP0k+bI/w0cflp/XMtB+ew=; b=MS5+RJ9Alapyzq7z5Gl8nhiTjV9MkYY9YSFOP9V6k1Oh9LWpymYosi63c5Tq6sMFyTlPyW y7FKMPQKZLaj5sk//6IGI6vunRSqf+GkBTbYRj/0obwh78dxdeGdUviKYxoRTrnmDR9BqU xyuQDDC8kRsOilyedUVYXsLHXmKPcqrzgiJGvjgj2mVZ4vr1eg4zMdbcTMABVkTaYlH5Aw gHafiQF2J4OAEHNvILMXdiXlTXUjLjlVRz97zVRDIQkD09l7ISr4ZjTVXR01sd2FgTILca CCA+b90c2BzQNdwhM9g+w96oi3wwPMizM562G25JZyHMqS88V8eXMFDq11nXpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679640014; 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=qGezSdg3Ntmew6q3uZ99fkP0k+bI/w0cflp/XMtB+ew=; b=IPFpqllE3QUPLdxPgeSZDzjwfqJccD0sa7CcnHnXNUUh57Jsl/jbvy7LrjSDAht2dxWmid CqzxCwA6M53UrgTRgdDLTeDFrhCS9TxUp7JfV8suWQGDHiPxVO82kvpcWLkCySN+sndpHi Nq2Tuu7mUKHKVBwqOYFzFkNcbyPMbgTQAdumiD/mEGzjWlI51MuTG6ZP+K1D1Assa1AYX2 BdqBM3pNlejCxiMAelimIXDHo7zKOVsJMdrs5xY0+Aka2jqNVP+FsBBjxiV+aQbUk91PJm zMcGPn9oKkWRa0rXI4I12bt+XvEncOek+uYJOyU8j9XiX5mtWJlXlcMEbkp5Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679640014; a=rsa-sha256; cv=none; b=WMsQ4TUmSVkurukv7YwOStGkDsnoy1lyfxo3f2xAgWCJyxC38hdPKUu7ByrE9/4/CEPtMY mInhCPpDvk2wdI90J7yTjVRhgIZvNsh83NJZl80N4si5Nzi3AhfRHj6aE9Uizp9rWDFmLp mDW+wCt5/RP8SzHA/v81NcIOwR3S/KQM9EcP1drvwNm8sUMUcw/klwEjpMhub8izHxK3Wm JZ+I8WyFwBTKqSvjJUqwofKb1fJJl+mvPk9Yco5Rs8tCFCSt8vBRtO59uydVa+Wb95A9aL VPjrtmhjYz2jAAf2nLkSRD/RsrZmEUg37S59Fv++aLqBDCOJJfV14/kK8DsBLQ== 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 4PjXdV3WV1z17PS; Fri, 24 Mar 2023 06:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32O6eEW1080438; Fri, 24 Mar 2023 06:40:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32O6eEcB080429; Fri, 24 Mar 2023 06:40:14 GMT (envelope-from git) Date: Fri, 24 Mar 2023 06:40:14 GMT Message-Id: <202303240640.32O6eEcB080429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: a836dce6d085 - stable/13 - cap_*(2): Document ENOSYS behavior. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a836dce6d08507cc556816a68697db36249ada66 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=a836dce6d08507cc556816a68697db36249ada66 commit a836dce6d08507cc556816a68697db36249ada66 Author: Xin LI AuthorDate: 2023-03-10 02:10:50 +0000 Commit: Xin LI CommitDate: 2023-03-24 06:39:58 +0000 cap_*(2): Document ENOSYS behavior. Summary: All cap_* system calls would fail when capability mode support is not present. Reviewed by: emaste, pauamma Differential Revision: https://reviews.freebsd.org/D38976 (cherry picked from commit 75798f9b01055261881938326a5c77e55f79c7f7) --- lib/libc/sys/cap_enter.2 | 7 +++---- lib/libc/sys/cap_fcntls_limit.2 | 5 ++++- lib/libc/sys/cap_ioctls_limit.2 | 29 ++++++++++++++--------------- lib/libc/sys/cap_rights_limit.2 | 5 ++++- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/libc/sys/cap_enter.2 b/lib/libc/sys/cap_enter.2 index 428e0b0bcd09..56fc78a4b4f2 100644 --- a/lib/libc/sys/cap_enter.2 +++ b/lib/libc/sys/cap_enter.2 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd March 9, 2023 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -113,9 +113,8 @@ system calls will fail if: .Bl -tag -width Er .It Bq Er ENOSYS -The kernel is compiled without: -.Pp -.Cd "options CAPABILITY_MODE" +The running kernel was compiled without +.Cd "options CAPABILITY_MODE" . .El .Pp The diff --git a/lib/libc/sys/cap_fcntls_limit.2 b/lib/libc/sys/cap_fcntls_limit.2 index b09aebbe78f0..b7b38ba2ab51 100644 --- a/lib/libc/sys/cap_fcntls_limit.2 +++ b/lib/libc/sys/cap_fcntls_limit.2 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd March 9, 2023 .Dt CAP_FCNTLS_LIMIT 2 .Os .Sh NAME @@ -111,6 +111,9 @@ argument is not a valid descriptor. The .Fa fcntlrightsp argument points at an invalid address. +.It Bq Er ENOSYS +The running kernel was compiled without +.Cd "options CAPABILITY_MODE" . .El .Sh SEE ALSO .Xr cap_ioctls_limit 2 , diff --git a/lib/libc/sys/cap_ioctls_limit.2 b/lib/libc/sys/cap_ioctls_limit.2 index 0cf5ea8ca038..6696434e0bac 100644 --- a/lib/libc/sys/cap_ioctls_limit.2 +++ b/lib/libc/sys/cap_ioctls_limit.2 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd March 9, 2023 .Dt CAP_IOCTLS_LIMIT 2 .Os .Sh NAME @@ -110,8 +110,11 @@ On failure the value .Va -1 is returned and the global variable errno is set to indicate the error. .Sh ERRORS +The .Fn cap_ioctls_limit -succeeds unless: +and +.Fn cap_ioctls_get +system calls will fail if: .Bl -tag -width Er .It Bq Er EBADF The @@ -121,6 +124,15 @@ argument is not a valid descriptor. The .Fa cmds argument points at an invalid address. +.It Bq Er ENOSYS +The running kernel was compiled without +.Cd "options CAPABILITY_MODE" . +.El +.Pp +The +.Fn cap_ioctls_limit +system call may also return the following errors: +.Bl -tag -width Er .It Bq Er EINVAL The .Fa ncmds @@ -132,19 +144,6 @@ would expand the list of allowed .Xr ioctl 2 commands. .El -.Pp -.Fn cap_ioctls_get -succeeds unless: -.Bl -tag -width Er -.It Bq Er EBADF -The -.Fa fd -argument is not a valid descriptor. -.It Bq Er EFAULT -The -.Fa cmds -argument points at invalid address. -.El .Sh SEE ALSO .Xr cap_fcntls_limit 2 , .Xr cap_rights_limit 2 , diff --git a/lib/libc/sys/cap_rights_limit.2 b/lib/libc/sys/cap_rights_limit.2 index 37f311143a28..f08d5520b66e 100644 --- a/lib/libc/sys/cap_rights_limit.2 +++ b/lib/libc/sys/cap_rights_limit.2 @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd March 9, 2023 .Dt CAP_RIGHTS_LIMIT 2 .Os .Sh NAME @@ -120,6 +120,9 @@ argument is not a valid active descriptor. .It Bq Er EINVAL An invalid right has been requested in .Fa rights . +.It Bq Er ENOSYS +The running kernel was compiled without +.Cd "options CAPABILITY_MODE" . .It Bq Er ENOTCAPABLE The .Fa rights