rust/helpers/security.c
Source file repositories/reference/linux-study-clean/rust/helpers/security.c
File Facts
- System
- Linux kernel
- Corpus path
rust/helpers/security.c- Extension
.c- Size
- 1173 bytes
- Lines
- 49
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/security.h
Detected Declarations
function rust_helper_security_cred_getsecidfunction rust_helper_security_secid_to_secctxfunction rust_helper_security_release_secctxfunction rust_helper_security_binder_set_context_mgrfunction rust_helper_security_binder_transactionfunction rust_helper_security_binder_transfer_binderfunction rust_helper_security_binder_transfer_file
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/security.h>
#ifndef CONFIG_SECURITY
__rust_helper void rust_helper_security_cred_getsecid(const struct cred *c,
u32 *secid)
{
security_cred_getsecid(c, secid);
}
__rust_helper int rust_helper_security_secid_to_secctx(u32 secid,
struct lsm_context *cp)
{
return security_secid_to_secctx(secid, cp);
}
__rust_helper void rust_helper_security_release_secctx(struct lsm_context *cp)
{
security_release_secctx(cp);
}
__rust_helper int
rust_helper_security_binder_set_context_mgr(const struct cred *mgr)
{
return security_binder_set_context_mgr(mgr);
}
__rust_helper int
rust_helper_security_binder_transaction(const struct cred *from,
const struct cred *to)
{
return security_binder_transaction(from, to);
}
__rust_helper int
rust_helper_security_binder_transfer_binder(const struct cred *from,
const struct cred *to)
{
return security_binder_transfer_binder(from, to);
}
__rust_helper int rust_helper_security_binder_transfer_file(
const struct cred *from, const struct cred *to, const struct file *file)
{
return security_binder_transfer_file(from, to, file);
}
#endif
Annotation
- Immediate include surface: `linux/security.h`.
- Detected declarations: `function rust_helper_security_cred_getsecid`, `function rust_helper_security_secid_to_secctx`, `function rust_helper_security_release_secctx`, `function rust_helper_security_binder_set_context_mgr`, `function rust_helper_security_binder_transaction`, `function rust_helper_security_binder_transfer_binder`, `function rust_helper_security_binder_transfer_file`.
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.