summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2025-03-04 10:31:55 +0000
committerPaul Moore <paul@paul-moore.com>2025-03-04 15:44:46 -0500
commit0a01beac927a1920487e40a2f9577e871261d89b (patch)
treef94bda08d2143d216fb889df95a231a876361f56 /rust/kernel
parent55e16418dd08fdccb7dc97fb8e975ded7c7ade9c (diff)
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 <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>
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/security.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/rust/kernel/security.rs b/rust/kernel/security.rs
index 243211050526..0c63e9e7e564 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) };
}
}