From nobody Thu Aug 24 22:46:29 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 4RWyqn5mrcz4rg7w; Thu, 24 Aug 2023 22:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RWyqn4s87z3fDt; Thu, 24 Aug 2023 22:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692917189; 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=8qtzJw90qODyL5EVspSn6XNOGXTCOpjkkpq02WobcdE=; b=eRwDXulJDur01kOURhfxHRd6R/IWUeTafgqf3FDhnkB/QIi5NV493s59h7iwS7hnK7w/lK usf0sw6vx/lQRNHXwgAKpHGI7E40s9R13NjnbLCi8wT8w3FOlBctJONX85uxF+Ciknf42c llM2lEQObEqTbrFDlqmT5TI/qfMaFx/tC78r2Lw5+WCVliy3AFjFzQxhVgpR7ABGeXlSq5 aP9cFqjKCpyi0L0g2y7rBVjLst7f1JJdJiwdmMTvrt2rCKQB3VeBiykpPlkLJ8geDnEQNY gZOKRRsmIX9yAXFTbQ39NSEp24cJHGJxUfiToadqXLajYhoPu8MpSSFvI4B+rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692917189; 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=8qtzJw90qODyL5EVspSn6XNOGXTCOpjkkpq02WobcdE=; b=clA5JU1iCcSojVUqJKe42556fx68ICSkmvXlFosR/ZvPFe3++bcwXjrsopqaIsev7Vtzks tpwJ2OqbYgvrmH54HTHuiUk74TCkTl96qMgF7maiyD/W8Q8NRJG+O+b9nCLXFv7/VIyU4Z Yin69ZyBnCZqRMGT/tXsn/i4efKcUljKGJK0Akl/H0EuWfdpUWUjjuPcKhNtZZE3MD5w7d ujov2HZfUm5IovWB5yfi8isLd2V/vDCbV02c+VVLS12rkFGN854OpDiQO8rXK2Yqphf0Lu sZCeBNj+po7a1N9O5vLl7zRZL//Q5TZnFfSEytcEwclY+bZrh/NHMAno9ec7WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692917189; a=rsa-sha256; cv=none; b=IZ2GG4KZt0qZkQVSSpOT1002RtY+lHAESGt1aYW4wS99qePFSRtln2kt7NotUNuD82DVOa MJwspQwJMK31H8Pqrmkc0BfqJtfxUeKvgJ6qIHDw286vWlSLhEAJ/OuLgn53R1Nbb5COr7 p13QJCRMrRqdiKVaTp0NS0HlcrMZDxMbn8QZUHewo9beRstmGyxBc9f4E/hTaH9bPNy987 mn5/tyJvtFxcdLqBQHpgIyiU3RpV1ctaZrsxQ/l8fQ00B4SNytGDtJ3lhh5s1BUAyVFFqY 8+ktGcmhMtvfVJEp+zw6NWoTgQqGNd4QxTaondxMNfetfHcToD+spevjFzu2Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RWyqn3nhxzlK9; Thu, 24 Aug 2023 22:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37OMkTaq024522; Thu, 24 Aug 2023 22:46:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37OMkTxX024519; Thu, 24 Aug 2023 22:46:29 GMT (envelope-from git) Date: Thu, 24 Aug 2023 22:46:29 GMT Message-Id: <202308242246.37OMkTxX024519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 30cdbb5833f6 - main - freebsd32: Remove mac_syscall from the unimpl list 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: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30cdbb5833f66354dee8e976bd1d7c2c699600c8 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=30cdbb5833f66354dee8e976bd1d7c2c699600c8 commit 30cdbb5833f66354dee8e976bd1d7c2c699600c8 Author: Stephen J. Kiernan AuthorDate: 2023-08-24 15:32:26 +0000 Commit: Stephen J. Kiernan CommitDate: 2023-08-24 22:45:31 +0000 freebsd32: Remove mac_syscall from the unimpl list The mac_syscall system call works fine as long as any MAC module that provides a mpo_syscall method handles compat32 appropriately. Regenerate system call files for freebsd32. Reviewed by: sjg Obtained from: Juniper Networks, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41575 --- sys/compat/freebsd32/freebsd32_syscall.h | 1 + sys/compat/freebsd32/freebsd32_syscalls.c | 2 +- sys/compat/freebsd32/freebsd32_sysent.c | 2 +- sys/compat/freebsd32/freebsd32_systrace_args.c | 30 ++++++++++++++++++++++++++ sys/compat/freebsd32/syscalls.conf | 4 ++-- 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index e3777730be1c..3123c3b1f74c 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -326,6 +326,7 @@ #define FREEBSD32_SYS_lchflags 391 #define FREEBSD32_SYS_uuidgen 392 #define FREEBSD32_SYS_freebsd32_sendfile 393 +#define FREEBSD32_SYS_mac_syscall 394 #define FREEBSD32_SYS_freebsd11_freebsd32_getfsstat 395 #define FREEBSD32_SYS_freebsd11_statfs 396 #define FREEBSD32_SYS_freebsd11_fstatfs 397 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index ccc910ee5ca9..e64c36b32d00 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -399,7 +399,7 @@ const char *freebsd32_syscallnames[] = { "lchflags", /* 391 = lchflags */ "uuidgen", /* 392 = uuidgen */ "freebsd32_sendfile", /* 393 = freebsd32_sendfile */ - "#394", /* 394 = mac_syscall */ + "mac_syscall", /* 394 = mac_syscall */ "compat11.freebsd32_getfsstat", /* 395 = freebsd11 freebsd32_getfsstat */ "compat11.statfs", /* 396 = freebsd11 statfs */ "compat11.fstatfs", /* 397 = freebsd11 fstatfs */ diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index fec6f4a47bd6..2bb45fc3d2e2 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -455,7 +455,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(lchflags_args), .sy_call = (sy_call_t *)sys_lchflags, .sy_auevent = AUE_LCHFLAGS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 391 = lchflags */ { .sy_narg = AS(uuidgen_args), .sy_call = (sy_call_t *)sys_uuidgen, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 392 = uuidgen */ { .sy_narg = AS(freebsd32_sendfile_args), .sy_call = (sy_call_t *)freebsd32_sendfile, .sy_auevent = AUE_SENDFILE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 393 = freebsd32_sendfile */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 394 = mac_syscall */ + { .sy_narg = AS(mac_syscall_args), .sy_call = (sy_call_t *)sys_mac_syscall, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 394 = mac_syscall */ { compat11(AS(freebsd11_freebsd32_getfsstat_args),freebsd32_getfsstat), .sy_auevent = AUE_GETFSSTAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 395 = freebsd11 freebsd32_getfsstat */ { compat11(AS(freebsd11_statfs_args),statfs), .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 396 = freebsd11 statfs */ { compat11(AS(freebsd11_fstatfs_args),fstatfs), .sy_auevent = AUE_FSTATFS, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 397 = freebsd11 fstatfs */ diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 2c26a0ddab2f..fb1fddc6ae5e 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -1848,6 +1848,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 8; break; } + /* mac_syscall */ + case 394: { + struct mac_syscall_args *p = params; + uarg[a++] = (intptr_t)p->policy; /* const char * */ + iarg[a++] = p->call; /* int */ + uarg[a++] = (intptr_t)p->arg; /* void * */ + *n_args = 3; + break; + } /* ksem_close */ case 400: { struct ksem_close_args *p = params; @@ -6328,6 +6337,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* mac_syscall */ + case 394: + switch (ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland void *"; + break; + default: + break; + }; + break; /* ksem_close */ case 400: switch (ndx) { @@ -10145,6 +10170,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* mac_syscall */ + case 394: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* ksem_close */ case 400: if (ndx == 0 || ndx == 1) diff --git a/sys/compat/freebsd32/syscalls.conf b/sys/compat/freebsd32/syscalls.conf index de198206dc47..af0409d8b3f1 100644 --- a/sys/compat/freebsd32/syscalls.conf +++ b/sys/compat/freebsd32/syscalls.conf @@ -47,7 +47,7 @@ syscall_no_abi_change="aio_cancel thr_exit thr_kill thr_kill2 thr_self thr_set_n obsol="getkerninfo" # Syscalls without implementations: -# *mac_* - should be implemented +# __mac_* - should be implemented # afs3_syscall - requires significant porting, probably doesn't make sense # kldsym - can't be implemented (kernel virtual addresses can't fit in 32-bits) # lgetfh - should be implemented @@ -55,4 +55,4 @@ obsol="getkerninfo" # nnpfs_syscall - requires significant porting, probably doesn't make sense # ntp_gettime - should be implemented # thr_create - was unimplemented and appears to be unnecessicary -unimpl="afs3_syscall kldsym __mac_get_proc __mac_set_proc __mac_get_fd __mac_get_file __mac_set_fd __mac_set_file __mac_get_pid __mac_get_link __mac_set_link __mac_execve mac_syscall nfssvc nlm_syscall ntp_gettime lgetfh nnpfs_syscall thr_create" +unimpl="afs3_syscall kldsym __mac_get_proc __mac_set_proc __mac_get_fd __mac_get_file __mac_set_fd __mac_set_file __mac_get_pid __mac_get_link __mac_set_link __mac_execve nfssvc nlm_syscall ntp_gettime lgetfh nnpfs_syscall thr_create"