18a4d24a3SOlivier Certner /*- 28a4d24a3SOlivier Certner * SPDX-License-Identifier: BSD-2-Clause 38a4d24a3SOlivier Certner * 48a4d24a3SOlivier Certner * Copyright (c) 2024 The FreeBSD Foundation 58a4d24a3SOlivier Certner * 68a4d24a3SOlivier Certner * This software was developed by Olivier Certner <olce.freebsd@certner.fr> at 78a4d24a3SOlivier Certner * Kumacom SARL under sponsorship from the FreeBSD Foundation. 88a4d24a3SOlivier Certner */ 98a4d24a3SOlivier Certner 108a4d24a3SOlivier Certner /* 118a4d24a3SOlivier Certner * Prototypes for functions used to implement system calls that must manipulate 128a4d24a3SOlivier Certner * MAC labels. 138a4d24a3SOlivier Certner */ 148a4d24a3SOlivier Certner 158a4d24a3SOlivier Certner #ifndef _SECURITY_MAC_MAC_SYSCALLS_H_ 168a4d24a3SOlivier Certner #define _SECURITY_MAC_MAC_SYSCALLS_H_ 178a4d24a3SOlivier Certner 188a4d24a3SOlivier Certner #ifndef _KERNEL 198a4d24a3SOlivier Certner #error "no user-serviceable parts inside" 208a4d24a3SOlivier Certner #endif 218a4d24a3SOlivier Certner 228a4d24a3SOlivier Certner int mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, 238a4d24a3SOlivier Certner char **const u_string); 248a4d24a3SOlivier Certner void free_copied_label(const struct mac *const mac); 258a4d24a3SOlivier Certner 26*3bdc5ba2SOlivier Certner #ifdef COMPAT_FREEBSD32 27*3bdc5ba2SOlivier Certner struct mac32; 28*3bdc5ba2SOlivier Certner 29*3bdc5ba2SOlivier Certner int mac_label_copyin32(const struct mac32 *const u_mac, 30*3bdc5ba2SOlivier Certner struct mac *const mac, char **const u_string); 31*3bdc5ba2SOlivier Certner #endif /* COMPAT_FREEBSD32 */ 32*3bdc5ba2SOlivier Certner 338a4d24a3SOlivier Certner int mac_set_proc_prepare(struct thread *const td, 348a4d24a3SOlivier Certner const struct mac *const mac, void **const mac_set_proc_data); 358a4d24a3SOlivier Certner int mac_set_proc_core(struct thread *const td, struct ucred *const newcred, 368a4d24a3SOlivier Certner void *const mac_set_proc_data); 378a4d24a3SOlivier Certner void mac_set_proc_finish(struct thread *const td, bool proc_label_set, 388a4d24a3SOlivier Certner void *const mac_set_proc_data); 398a4d24a3SOlivier Certner 408a4d24a3SOlivier Certner #endif /* !_SECURITY_MAC_MAC_SYSCALLS_H_ */ 41