From nobody Sat Nov 07 12:11: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 4jMFJ86nxBz6yWH1 for ; Sat, 07 Nov 2026 12:11: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 4jMFJ82CN4z3CPv for ; Sat, 07 Nov 2026 12:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794053464; 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=rh+sY6u7a7jIUV2XL9tu/O0LCCUnOiFe/a+Ot15ARog=; b=HkR+A1qKbBgXNP7cQYSIR8TZ8u3MrEyw3J/v8taAz7xCj/oJRDCCtFid9xs7Q0TBWxK19N xQf8u98rWrIiJQ3DOFRD4k5tXQyrYNaHV0YmLEvpBckkk+iKS+jVB+A1sObcd6XJCQkC7l TqEm8S6dFpLZSJwUyRBALQgyenE+QQTANYZexEfp1XXFjJxL5qXkTdL36j85Bb4SsIcd8B D5u3DuqaBf4/ykI1kHn01tnprEHbAa+qyfoL9idtSg0v1YFmqPPpA6UcS32wulz+ORsvaF 7Sfi/0TZdRxpB6rVUpSyqwi891uTpSL6Yz/mPXMVQA9YwopVCkiGKdDSsdxdBw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794053464; b=qv0kIpMVytfQPlITIeDkyMoWaR20QXx3KhrxcSvDSSzAvhfuVrEMJng8ywsP/u6TDg7hPJ ljfWooAoIB8qMONv0Fs2hvtMFbfNjAp5E21Ft8q3ghgWZGPplAdy5MULCr8Kcywh45BhLB GvQF/TVxNk6MR9HzDxK7+ZnMm+hMTNscd89mBAyyEyjIFJJ6/mIOomQhzWqmvLANNhTvmd 7NUXUe1ptTkov5kyQwS8xcfYr16G/c6rxjJLT3/QSLWdgkNx0Ioz6QtidynMEDbp7Oo7O7 pXa/yaj1PruSzkWCrkSZKSIwU3nO1ZmMT8v5Hj8LezGj0OTHvOu1VpAm/BZTTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794053464; 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=rh+sY6u7a7jIUV2XL9tu/O0LCCUnOiFe/a+Ot15ARog=; b=Ne44rZlXQl5eqZsg/pSnMb9tVS6OtYKSLWtv+x6abeEk7mYmkmtuhU+a2FXiSqS4i2339x flJv9xzHxixY+Tdo6HQGnXR+aHiDqIkA8cKj6rCoUkEeZPSbDQ8rWKN/l7AyPbsJt2ejcK 1dNPX1WYKN9jrvw9+MMnm/MEMc+wx1hQonYrvI4W24nBgEBirKOCiMQvPY/8BzN6WjYlLR 1KZhAF2dvYlgz+cJLSo4mic7aNTuLsagh+3fgQzFAJUrTgMlqMMnB+E+rrhI0YkkxEAmuR 3EbZVBEnPw4cE/7FrOIM8NAI89LJsIMX3B6bZhc+pH0feMQ+MONjVsBxYjMIHQ== 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 4jMFJ810pVzLYq for ; Sat, 07 Nov 2026 12:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47a84 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 07 Nov 2026 12:11:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 230d581d4e8c - main - fstat(2): add user_fstat List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 230d581d4e8c3017d4e711dc97f2b53ebe1ea7ee Auto-Submitted: auto-generated Date: Sat, 07 Nov 2026 12:11:04 +0000 Message-Id: <6aef1558.47a84.375cc896@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=230d581d4e8c3017d4e711dc97f2b53ebe1ea7ee commit 230d581d4e8c3017d4e711dc97f2b53ebe1ea7ee Author: Brooks Davis AuthorDate: 2026-11-07 12:10:46 +0000 Commit: Brooks Davis CommitDate: 2026-11-07 12:10:46 +0000 fstat(2): add user_fstat Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284 --- sys/kern/kern_descrip.c | 15 ++++++++------- sys/sys/syscallsubr.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 0fa8210b71c0..400996f6f32a 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -374,7 +374,6 @@ struct dup2_args { int sys_dup2(struct thread *td, struct dup2_args *uap) { - return (kern_dup(td, FDDUP_FIXED, 0, (int)uap->from, (int)uap->to)); } @@ -390,7 +389,6 @@ struct dup_args { int sys_dup(struct thread *td, struct dup_args *uap) { - return (kern_dup(td, FDDUP_NORMAL, 0, (int)uap->fd, 0)); } @@ -408,7 +406,6 @@ struct fcntl_args { int sys_fcntl(struct thread *td, struct fcntl_args *uap) { - return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, uap->arg)); } @@ -1493,7 +1490,6 @@ struct close_args { int sys_close(struct thread *td, struct close_args *uap) { - return (kern_close(td, uap->fd)); } @@ -1610,7 +1606,6 @@ struct close_range_args { int sys_close_range(struct thread *td, struct close_range_args *uap) { - AUDIT_ARG_FD(uap->lowfd); AUDIT_ARG_CMD(uap->highfd); AUDIT_ARG_FFLAGS(uap->flags); @@ -1703,13 +1698,19 @@ struct fstat_args { /* ARGSUSED */ int sys_fstat(struct thread *td, struct fstat_args *uap) +{ + return (user_fstat(td, uap->fd, uap->sb)); +} + +int +user_fstat(struct thread *td, int fd, struct stat *sb) { struct stat ub; int error; - error = kern_fstat(td, uap->fd, &ub); + error = kern_fstat(td, fd, &ub); if (error == 0) - error = copyout(&ub, uap->sb, sizeof(ub)); + error = copyout(&ub, sb, sizeof(ub)); return (error); } diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 7f07e200ec58..7c53dcc2d658 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -472,6 +472,7 @@ 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_fstat(struct thread *td, int fd, struct stat *sb); int user_jail_get(struct thread *td, struct iovec *iovp, unsigned int iovcnt, int flags, copyinuio_t *copyinuio_f, updateiov_t *updateiov_f);