Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: security: add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Alice Ryhl and committed by
Paul Moore
2d38a4e3 517fd96c

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