• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/security.h>
4 
5 #ifndef CONFIG_SECURITY
rust_helper_security_cred_getsecid(const struct cred * c,u32 * secid)6 void rust_helper_security_cred_getsecid(const struct cred *c, u32 *secid)
7 {
8 	security_cred_getsecid(c, secid);
9 }
10 
rust_helper_security_secid_to_secctx(u32 secid,char ** secdata,u32 * seclen)11 int rust_helper_security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
12 {
13 	return security_secid_to_secctx(secid, secdata, seclen);
14 }
15 
rust_helper_security_release_secctx(char * secdata,u32 seclen)16 void rust_helper_security_release_secctx(char *secdata, u32 seclen)
17 {
18 	security_release_secctx(secdata, seclen);
19 }
20 
rust_helper_security_binder_set_context_mgr(const struct cred * mgr)21 int rust_helper_security_binder_set_context_mgr(const struct cred *mgr)
22 {
23 	return security_binder_set_context_mgr(mgr);
24 }
25 
rust_helper_security_binder_transaction(const struct cred * from,const struct cred * to)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 
rust_helper_security_binder_transfer_binder(const struct cred * from,const struct cred * to)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 
rust_helper_security_binder_transfer_file(const struct cred * from,const struct cred * to,const struct file * file)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