summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2026-10-16 17:01:58 -0400
committerPaul Moore <paul@paul-moore.com>2026-10-16 17:01:58 -0400
commit436485132d2367a50aa22dcc8a89faeee24a4cc9 (patch)
treef4c7cafad0ec42898880ea53ab0ecd2a7b147cde /rust/kernel
parentfd73f4a6659897191fa0d40695fe370925dd3780 (diff)
parent881f19c2ffbc73f351b257e09c71e6059939b770 (diff)
downloadlinux-436485132d2367a50aa22dcc8a89faeee24a4cc9.tar.gz
linux-436485132d2367a50aa22dcc8a89faeee24a4cc9.zip
Automated merge of 'lsm/dev' into 'stable-7.4'
Manual merge fixup in ns_common_types.h:ns_common to work around a conflict with the nsfs RCU grace period fix. * lsm/dev: lsm: remove redundant NULL check in security_init() selftests/landlock: Check full ioctl commands in audit records lsm: Preserve full ioctl commands in audit records doc: fix LSM ordering description for /sys/kernel/security/lsm doc: describe CONFIG_LSM and lsm= as the selection mechanism selftests/bpf: verify mount idmaps reach inode hooks lsm: expose mount idmaps to inode hooks rust: lsm: replace `core::mem::zeroed` with `pin_init::zeroed` cred: prevent slab cache merging for cred_jar lsm: don't call security_backing_file_free() multiple times lsm: delete duplicate assignment in lsm_prepare() lsm: update the BUILD_BUG_ON() in audit_log_lsm_data() lsm: add LSM_AUDIT_DATA_NS for namespace audit records lsm: add LSM blob and hooks for namespaces ns: Free anonymous mount namespaces via ns_common_free() cred: clarify that task_struct::cred is only for the current task
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/security.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/rust/kernel/security.rs b/rust/kernel/security.rs
index 9d271695265f..4dc3eba6ce84 100644
--- a/rust/kernel/security.rs
+++ b/rust/kernel/security.rs
@@ -62,8 +62,7 @@ impl SecurityCtx {
/// Get the security context given its id.
#[inline]
pub fn from_secid(secid: u32) -> Result<Self> {
- // SAFETY: `struct lsm_context` can be initialized to all zeros.
- let mut ctx: bindings::lsm_context = unsafe { core::mem::zeroed() };
+ let mut ctx: bindings::lsm_context = pin_init::zeroed();
// SAFETY: Just a C FFI call. The pointer is valid for writes.
to_result(unsafe { bindings::security_secid_to_secctx(secid, &mut ctx) })?;