From nobody Tue Sep 29 18:14:29 2026 X-Original-To: dev-commits-src-main@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 4hvRCT4XRCz6ttrX for ; Tue, 29 Sep 2026 18:14:29 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvRCT3tYqz4Dw8 for ; Tue, 29 Sep 2026 18:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790705669; 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=s0s+uExaWwZxTmPaXgmtKKW1tPzGacITN6pTnOTJJ7A=; b=W7lHU/x+N3r/6fKKqqllvVjwqoiMU3xAZCxKiEnzyTq8FAMnA+UB6GbO/8kZ7AzFM41UQv x+VeSuz+EgJa7LLWzwIL9pNyvoJTZKLSvxGs0MBEYUofdUxZGXtBg/a5it+2CvWHQ2WJ6+ CPfwGxH/uWLG3FEPzrOpurOmtvYpWNVsiYdq0k3DcKBZ7UXRlT16uuseKtgzz0AGQs/eGB Lqu9sAxVAT/u8xHJd/2mzonTG1la6dMttg9AY2YVs06C7/EV5xyQK8A1aKasOBwMlpZjTo JOIk2MmCx1IhZszjuE8t5VhGwIi7NhPIFeTQG5b+NLrQPiMc10rSbhWwvMvmmw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790705669; b=u0/MbF4T9y236yLfB4NM4iVETh+XUpN22/SHr9nvR6gkteEd0CYyDywM/hyknedlcmVdAT VTQMswpanPgWvfBijMdaTitrY59Yn3Ov8TjcLiYNXWGzKa2wYx30vmLCzKdU+9ghKjMQQU YmHWE+S7dO5a0LxxcuDGNZfxIWf9GSeIRye70pUZxutj25Lh6XlgQlj2lqq92L63njJSvI 7t1xjR/aowQU6+YfHcY3UNuG6Gf9GPka190X4LeBRktg8tNSWn1X5XyQIlCWJc1jP0Ygda wJspcUNhaLS8f+oYEFriYx9d9T0pxcf3gqKWiY7DbBq60ww3hCyfRxn7Q2attQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790705669; 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=s0s+uExaWwZxTmPaXgmtKKW1tPzGacITN6pTnOTJJ7A=; b=CZ2Tgk+mGGm8cGB9d/NFSJIYratVDxNWGIj6k/4UUPfaMreOly1LJriVVgVrPaipMShMno taycdgbERDaTiYjlbvfO9hf9kNfrM6pSPWs/lM6Td539ah65xqRRsbYDqL414gsihI8kd0 yOYxzn0xYwuFq5aO7F23/8KeR7S/4dKjrJd86L8CAlOynk/qOzKrLuYPKGSmpSMoyTjPfy RdisG2wnKdDj++mif+hyKyQuMztgeFKsoK3lEd3CLPe+dWuwcamoJekI9FlRGJ/mXu53Gy 8xBNbw3KRawFrkWXysIkSuW0SEiqN5iqDLyNeZWRD15kjRQtohUboQ3zVjCZ+A== 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 4hvRCT2yFNz1NjJ for ; Tue, 29 Sep 2026 18:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d6ad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 29 Sep 2026 18:14:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2127135a22e3 - main - jail_{get,set}: user_ implementations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: 2127135a22e3f9eafa4ba4ca819d4971b6e27125 Auto-Submitted: auto-generated Date: Tue, 29 Sep 2026 18:14:29 +0000 Message-Id: <6abc0005.3d6ad.2b408812@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2127135a22e3f9eafa4ba4ca819d4971b6e27125 commit 2127135a22e3f9eafa4ba4ca819d4971b6e27125 Author: Brooks Davis AuthorDate: 2026-09-29 17:30:40 +0000 Commit: Brooks Davis CommitDate: 2026-09-29 18:14:07 +0000 jail_{get,set}: user_ implementations This will enable compat implementations in the future. Reviewed by: jamie, jhb Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D60026 --- sys/kern/kern_jail.c | 32 ++++++++++++++++++++++++-------- sys/sys/syscallsubr.h | 5 +++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 79922c3a0d38..3b9809671f21 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -575,18 +575,26 @@ kern_jail(struct thread *td, struct jail *j) */ int sys_jail_set(struct thread *td, struct jail_set_args *uap) +{ + return (user_jail_set(td, uap->iovp, uap->iovcnt, uap->flags, + copyinuio)); +} + +int +user_jail_set(struct thread *td, struct iovec *iovp, + unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f) { struct uio *auio; int error; /* Check that we have an even number of iovecs. */ - if (uap->iovcnt & 1) + if (iovcnt & 1) return (EINVAL); - error = copyinuio(uap->iovp, uap->iovcnt, &auio); + error = copyinuio_f(iovp, iovcnt, &auio); if (error) return (error); - error = kern_jail_set(td, auio, uap->flags); + error = kern_jail_set(td, auio, flags); freeuio(auio); return (error); } @@ -2560,21 +2568,29 @@ get_next_deadid(struct prison **dinsprp) */ int sys_jail_get(struct thread *td, struct jail_get_args *uap) +{ + return (user_jail_get(td, uap->iovp, uap->iovcnt, uap->flags, + copyinuio, updateiov)); +} + +int +user_jail_get(struct thread *td, struct iovec *iovp, + unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f, + updateiov_t *updateiov_f) { struct uio *auio; int error; /* Check that we have an even number of iovecs. */ - if (uap->iovcnt & 1) + if (iovcnt & 1) return (EINVAL); - error = copyinuio(uap->iovp, uap->iovcnt, &auio); + error = copyinuio_f(iovp, iovcnt, &auio); if (error) return (error); - error = kern_jail_get(td, auio, uap->flags); + error = kern_jail_get(td, auio, flags); if (error == 0) - error = copyout(auio->uio_iov, uap->iovp, - uap->iovcnt * sizeof(struct iovec)); + error = updateiov_f(auio, iovp); freeuio(auio); return (error); } diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index d38d10880ec8..d767ba29cdf6 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -445,6 +445,11 @@ int user_cpuset_getaffinity(struct thread *td, cpulevel_t level, int user_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *maskp, const struct cpuset_copy_cb *cb); +int user_jail_get(struct thread *td, struct iovec *iovp, + unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f, + updateiov_t *updateiov_f); +int user_jail_set(struct thread *td, struct iovec *iovp, + unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f); /* flags for kern_sigaction */ #define KSA_OSIGSET 0x0001 /* uses osigact_t */