]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lsm,rust: reword "destroy" -> "release" in SecurityCtx
authorAlice Ryhl <aliceryhl@google.com>
Tue, 4 Mar 2025 10:31:55 +0000 (10:31 +0000)
committerPaul Moore <paul@paul-moore.com>
Tue, 4 Mar 2025 20:44:46 +0000 (15:44 -0500)
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 <casey@schaufler-ca.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
[PM: subj tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
rust/kernel/security.rs

index 24321105052648e150f2875bcfa5ef29f4249516..0c63e9e7e564b7d9d85865e5415dd0464e9a9098 100644 (file)
@@ -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) };
     }
 }