aboutsummaryrefslogtreecommitdiff
path: root/sys/security
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2025-11-24 15:47:20 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2025-11-24 15:47:20 +0000
commit134d00bd2c910cc7cc21c11fba093ff82bbb9344 (patch)
treedcb1b75a2f9950105c0a6aa1aa20383e1a3933b5 /sys/security
parente928afc531e68b7a142ee49d8f7e5c8426d54033 (diff)
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac/mac_syscalls.c25
-rw-r--r--sys/security/mac/mac_syscalls.h9
2 files changed, 6 insertions, 28 deletions
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
index 26181781a394..13c7998041f9 100644
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -57,6 +57,7 @@
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
+#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/vnode.h>
#include <sys/mount.h>
@@ -94,15 +95,15 @@ struct mac32 {
* after use by calling free_copied_label() (which see). On success, 'u_string'
* if not NULL is filled with the userspace address for 'u_mac->m_string'.
*/
-static int
-mac_label_copyin_impl(const void *const u_mac, struct mac *const mac,
- char **const u_string, bool is_32bit)
+int
+mac_label_copyin(const void *const u_mac, struct mac *const mac,
+ char **const u_string)
{
char *buffer;
int error;
#ifdef COMPAT_FREEBSD32
- if (is_32bit) {
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
struct mac32 mac32;
error = copyin(u_mac, &mac32, sizeof(mac32));
@@ -138,28 +139,12 @@ mac_label_copyin_impl(const void *const u_mac, struct mac *const mac,
return (0);
}
-int
-mac_label_copyin(const struct mac *const u_mac, struct mac *const mac,
- char **const u_string)
-{
- return (mac_label_copyin_impl(u_mac, mac, u_string, false));
-}
-
void
free_copied_label(const struct mac *const mac)
{
free(mac->m_string, M_MACTEMP);
}
-#ifdef COMPAT_FREEBSD32
-int
-mac_label_copyin32(const struct mac32 *const u_mac,
- struct mac *const mac, char **const u_string)
-{
- return (mac_label_copyin_impl(u_mac, mac, u_string, true));
-}
-#endif
-
int
sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap)
{
diff --git a/sys/security/mac/mac_syscalls.h b/sys/security/mac/mac_syscalls.h
index 4efeaf300d31..f95ff3ef1264 100644
--- a/sys/security/mac/mac_syscalls.h
+++ b/sys/security/mac/mac_syscalls.h
@@ -19,17 +19,10 @@
#error "no user-serviceable parts inside"
#endif
-int mac_label_copyin(const struct mac *const u_mac, struct mac *const mac,
+int mac_label_copyin(const void *const u_mac, struct mac *const mac,
char **const u_string);
void free_copied_label(const struct mac *const mac);
-#ifdef COMPAT_FREEBSD32
-struct mac32;
-
-int mac_label_copyin32(const struct mac32 *const u_mac,
- struct mac *const mac, char **const u_string);
-#endif /* COMPAT_FREEBSD32 */
-
int mac_set_proc_prepare(struct thread *const td,
const struct mac *const mac, void **const mac_set_proc_data);
int mac_set_proc_core(struct thread *const td, struct ucred *const newcred,