From: Alice Ryhl Date: Tue, 4 Mar 2025 10:31:55 +0000 (+0000) Subject: lsm,rust: reword "destroy" -> "release" in SecurityCtx X-Git-Tag: v6.15-rc1~189^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a01beac927a1920487e40a2f9577e871261d89b;p=thirdparty%2Fkernel%2Flinux.git lsm,rust: reword "destroy" -> "release" in SecurityCtx What happens inside the individual LSMs for a given LSM hook can vary quite a bit, so it is best to use the terminology "release" instead of "destroy" or "free". Suggested-by: Casey Schaufler Signed-off-by: Alice Ryhl Acked-by: Casey Schaufler Reviewed-by: Fiona Behrens [PM: subj tweak] Signed-off-by: Paul Moore --- diff --git a/rust/kernel/security.rs b/rust/kernel/security.rs index 2432110505264..0c63e9e7e564b 100644 --- a/rust/kernel/security.rs +++ b/rust/kernel/security.rs @@ -16,7 +16,7 @@ use crate::{ /// # Invariants /// /// The `ctx` field corresponds to a valid security context as returned by a successful call to -/// `security_secid_to_secctx`, that has not yet been destroyed by `security_release_secctx`. +/// `security_secid_to_secctx`, that has not yet been released by `security_release_secctx`. pub struct SecurityCtx { ctx: bindings::lsm_context, } @@ -67,9 +67,8 @@ impl SecurityCtx { impl Drop for SecurityCtx { #[inline] fn drop(&mut self) { - // SAFETY: By the invariant of `Self`, this frees a context that came from a successful - // call to `security_secid_to_secctx` and has not yet been destroyed by - // `security_release_secctx`. + // SAFETY: By the invariant of `Self`, this releases an lsm context that came from a + // successful call to `security_secid_to_secctx` and has not yet been released. unsafe { bindings::security_release_secctx(&mut self.ctx) }; } }