From nobody Wed Nov 11 13:21:04 2026 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 4jPkg46bkGz70CZ4 for ; Wed, 11 Nov 2026 13:21:04 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPkg40njzz4CLr for ; Wed, 11 Nov 2026 13:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794403264; 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=iY8fHu3DCZz9mXy0ZXZq1KWO7SK9UjN5E2y9tamRi10=; b=iricCHlBP1WE1dBiImdcQau24HB8SGGDBlWmlerwBtGz3zzL1jjqGBXlX8RXGCjCuho+4v 5dBcZlf/51idZLnukMsr3bJoW3c6b4b6u590PwcSyrVE2oNS9ImZuMZBb72tw6zIHFwOqE N2S5pfV2vHzO/LdZd+O51/F28a8zIuQtXqpGEDBWB0EOjo7HIYilAGeyDsbvXdV11Brhiw 2sA6FeNgxaGe0Z/eWVkKrKtYtTaWXs+MX6vsY3zYPbvTd+N3qXRb1dzJey8rDvXDBIYRk/ YvO6lrT7AOVRGFDCUjHAVfuwr4DtD40+CFzeeNte6wNk4XiHZNbiIRuqMYPnOg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794403264; b=k7QTuZP66yw8S5Uk+jr+C2G44KAwcew+yhTGTIuReN6/stFgu867Avrv7ldV1LJ/EeQPK8 6EGaqWODX7LulEYiwcwcCQ+CByRW+TMCTiQs0Wj6HKxsaHIrQ3Bu5r+sUJwiMq/Ci0YFb2 MypnUJJljfKW17cAEEh3bj5ZGic91jJQFCJ67dchq/tbsoO2F2qxZtDglibhurdOBxITYX 8CP6+mACZL7rf8gl1lvcQNa4qSvlv4ZsMVo5Qh9bVkRBldo2S5a9BsZpp6/5rsnAQAduz3 /ymDL+OWhATqwGdI6nkbCV4H9/lnGQ4udmazappDcu4iM+fhJPkztSZWEJs4pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794403264; 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=iY8fHu3DCZz9mXy0ZXZq1KWO7SK9UjN5E2y9tamRi10=; b=BEJHXkFl5vVuDSFA7mrkZiyt7kGpnIJeb0ZhSF0QF0ZLt2Z/6UrdmQTWGDWhTKbVKbAo7l PEY2gatBs5LRPmsyhkvy5p8kmfWDe3TaCz3r6QG9Y/3J4uG6bGMqLlLQOjkFIenAiHg0p+ yAi8BLsxvrboiwD8C2nsaspyAUIxtg6pLs7g4ytgatAaa1pnCIl9gKsmi81keu8TYQDg7w JjmhnhHSqGi93mSFksFPCO1nbPJqfYfB/McpauUn/BDg6aS/QwxW9jYhslHwAeDV/4OQWw HxOfVs8zs785mC4a3+ywVSyx8aEwNwaqNr4xl0eRACYNQlCVyf5J7up5udSjPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jPkg40SqYzGYQ for ; Wed, 11 Nov 2026 13:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8220 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 11 Nov 2026 13:21:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 6e87733f73ff - main - __acl_*(2): add kern_ implementations List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e87733f73ff2bc1a5b2d1a370c15e4907deb326 Auto-Submitted: auto-generated Date: Wed, 11 Nov 2026 13:21:04 +0000 Message-Id: <6af46bc0.8220.2948c368@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=6e87733f73ff2bc1a5b2d1a370c15e4907deb326 commit 6e87733f73ff2bc1a5b2d1a370c15e4907deb326 Author: Brooks Davis AuthorDate: 2025-11-24 20:28:54 +0000 Commit: Brooks Davis CommitDate: 2026-11-11 13:14:43 +0000 __acl_*(2): add kern_ implementations Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284 --- sys/kern/vfs_acl.c | 59 ++++++++++++++++++++++++++++++--------------------- sys/sys/syscallsubr.h | 15 +++++++++++++ 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 6076a5f7bdf8..eb0c6029716b 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -63,14 +64,6 @@ CTASSERT(ACL_MAX_ENTRIES >= OLDACL_MAX_ENTRIES); MALLOC_DEFINE(M_ACL, "acl", "Access Control Lists"); -static int kern___acl_aclcheck_path(struct thread *td, const char *path, - acl_type_t type, struct acl *aclp, int follow); -static int kern___acl_delete_path(struct thread *td, const char *path, - acl_type_t type, int follow); -static int kern___acl_get_path(struct thread *td, const char *path, - acl_type_t type, struct acl *aclp, int follow); -static int kern___acl_set_path(struct thread *td, const char *path, - acl_type_t type, const struct acl *aclp, int follow); static int vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type, const struct acl *aclp); static int vacl_get_acl(struct thread *td, struct vnode *vp, @@ -366,7 +359,7 @@ sys___acl_get_link(struct thread *td, struct __acl_get_link_args *uap) NOFOLLOW)); } -static int +int kern___acl_get_path(struct thread *td, const char *path, acl_type_t type, struct acl *aclp, int follow) { @@ -405,7 +398,7 @@ sys___acl_set_link(struct thread *td, struct __acl_set_link_args *uap) NOFOLLOW)); } -static int +int kern___acl_set_path(struct thread *td, const char *path, acl_type_t type, const struct acl *aclp, int follow) { @@ -427,16 +420,23 @@ kern___acl_set_path(struct thread *td, const char *path, */ int sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) +{ + return (kern___acl_get_fd(td, uap->filedes, uap->type, uap->aclp)); +} + +int +kern___acl_get_fd(struct thread *td, int filedes, acl_type_t type, + struct acl *aclp) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->filedes); - error = getvnode_path(td, uap->filedes, + AUDIT_ARG_FD(filedes); + error = getvnode_path(td, filedes, cap_rights_init_one(&rights, CAP_ACL_GET), NULL, &fp); if (error == 0) { - error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); + error = vacl_get_acl(td, fp->f_vnode, type, aclp); fdrop(fp, td); } return (error); @@ -447,16 +447,23 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) */ int sys___acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) +{ + return (kern___acl_set_fd(td, uap->filedes, uap->type, uap->aclp)); +} + +int +kern___acl_set_fd(struct thread *td, int filedes, acl_type_t type, + const struct acl *aclp) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->filedes); - error = getvnode(td, uap->filedes, + AUDIT_ARG_FD(filedes); + error = getvnode(td, filedes, cap_rights_init_one(&rights, CAP_ACL_SET), &fp); if (error == 0) { - error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp); + error = vacl_set_acl(td, fp->f_vnode, type, aclp); fdrop(fp, td); } return (error); @@ -468,7 +475,6 @@ sys___acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) int sys___acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) { - return (kern___acl_delete_path(td, uap->path, uap->type, FOLLOW)); } @@ -478,11 +484,10 @@ sys___acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) int sys___acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap) { - return (kern___acl_delete_path(td, uap->path, uap->type, NOFOLLOW)); } -static int +int kern___acl_delete_path(struct thread *td, const char *path, acl_type_t type, int follow) { @@ -525,7 +530,6 @@ sys___acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) int sys___acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) { - return (kern___acl_aclcheck_path(td, uap->path, uap->type, uap->aclp, FOLLOW)); } @@ -540,7 +544,7 @@ sys___acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap) NOFOLLOW)); } -static int +int kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, struct acl *aclp, int follow) { @@ -562,16 +566,23 @@ kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, */ int sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) +{ + return (kern___acl_aclcheck_fd(td, uap->filedes, uap->type, uap->aclp)); +} + +int +kern___acl_aclcheck_fd(struct thread *td, int filedes, acl_type_t type, + const struct acl *aclp) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->filedes); - error = getvnode_path(td, uap->filedes, + AUDIT_ARG_FD(filedes); + error = getvnode_path(td, filedes, cap_rights_init_one(&rights, CAP_ACL_CHECK), NULL, &fp); if (error == 0) { - error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); + error = vacl_aclcheck(td, fp->f_vnode, type, aclp); fdrop(fp, td); } return (error); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 794eaf58b618..2f65eb2aaed4 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -39,6 +39,7 @@ #include struct __wrusage; +struct acl; struct cpuset_copy_cb; struct ffclock_estimate; struct file; @@ -120,6 +121,20 @@ typedef int (copyinuio_t)(const void *iovp, unsigned int iovcnt, typedef int (updateiov_t)(const struct uio *uiop, void *iovp); uint64_t at2cnpflags(u_int at_flags, u_int mask); +int kern___acl_aclcheck_fd(struct thread *td, int filedes, + __acl_type_t type, const struct acl *aclp); +int kern___acl_aclcheck_path(struct thread *td, const char *path, + __acl_type_t type, struct acl *aclp, int follow); +int kern___acl_delete_path(struct thread *td, const char *path, + __acl_type_t type, int follow); +int kern___acl_get_fd(struct thread *td, int filedes, __acl_type_t type, + struct acl *aclp); +int kern___acl_get_path(struct thread *td, const char *path, + __acl_type_t type, struct acl *aclp, int follow); +int kern___acl_set_fd(struct thread *td, int filedes, __acl_type_t type, + const struct acl *aclp); +int kern___acl_set_path(struct thread *td, const char *path, + __acl_type_t type, const struct acl *aclp, int follow); int kern___cap_rights_get(struct thread *td, int version, int fd, cap_rights_t *rightsp); int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg,