xref: /freebsd/sys/security/mac/mac_syscalls.h (revision 8a4d24a39098ed8170a37ca2aa83bf1da1976de1)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2024 The FreeBSD Foundation
5  *
6  * This software was developed by Olivier Certner <olce.freebsd@certner.fr> at
7  * Kumacom SARL under sponsorship from the FreeBSD Foundation.
8  */
9 
10 /*
11  * Prototypes for functions used to implement system calls that must manipulate
12  * MAC labels.
13  */
14 
15 #ifndef _SECURITY_MAC_MAC_SYSCALLS_H_
16 #define _SECURITY_MAC_MAC_SYSCALLS_H_
17 
18 #ifndef _KERNEL
19 #error "no user-serviceable parts inside"
20 #endif
21 
22 int	mac_label_copyin(const struct mac *const u_mac, struct mac *const mac,
23 	    char **const u_string);
24 void	free_copied_label(const struct mac *const mac);
25 
26 int	mac_set_proc_prepare(struct thread *const td,
27 	    const struct mac *const mac, void **const mac_set_proc_data);
28 int	mac_set_proc_core(struct thread *const td, struct ucred *const newcred,
29 	    void *const mac_set_proc_data);
30 void	mac_set_proc_finish(struct thread *const td, bool proc_label_set,
31 	    void *const mac_set_proc_data);
32 
33 #endif /* !_SECURITY_MAC_MAC_SYSCALLS_H_ */
34