xref: /linux/rust/helpers/security.c (revision 6093a688a07da07808f0122f9aa2a3eed250d853)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/security.h>
4 
5 #ifndef CONFIG_SECURITY
6 void rust_helper_security_cred_getsecid(const struct cred *c, u32 *secid)
7 {
8 	security_cred_getsecid(c, secid);
9 }
10 
11 int rust_helper_security_secid_to_secctx(u32 secid, struct lsm_context *cp)
12 {
13 	return security_secid_to_secctx(secid, cp);
14 }
15 
16 void rust_helper_security_release_secctx(struct lsm_context *cp)
17 {
18 	security_release_secctx(cp);
19 }
20 
21 int rust_helper_security_binder_set_context_mgr(const struct cred *mgr)
22 {
23 	return security_binder_set_context_mgr(mgr);
24 }
25 
26 int rust_helper_security_binder_transaction(const struct cred *from,
27 					    const struct cred *to)
28 {
29 	return security_binder_transaction(from, to);
30 }
31 
32 int rust_helper_security_binder_transfer_binder(const struct cred *from,
33 						const struct cred *to)
34 {
35 	return security_binder_transfer_binder(from, to);
36 }
37 
38 int rust_helper_security_binder_transfer_file(const struct cred *from,
39 					      const struct cred *to,
40 					      const struct file *file)
41 {
42 	return security_binder_transfer_file(from, to, file);
43 }
44 #endif
45