Skip to content

Commit 0a01bea

Browse files
Darksonnpcmoore
authored andcommitted
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 <[email protected]> Signed-off-by: Alice Ryhl <[email protected]> Acked-by: Casey Schaufler <[email protected]> Reviewed-by: Fiona Behrens <[email protected]> [PM: subj tweak] Signed-off-by: Paul Moore <[email protected]>
1 parent 55e1641 commit 0a01bea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rust/kernel/security.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
/// # Invariants
1717
///
1818
/// The `ctx` field corresponds to a valid security context as returned by a successful call to
19-
/// `security_secid_to_secctx`, that has not yet been destroyed by `security_release_secctx`.
19+
/// `security_secid_to_secctx`, that has not yet been released by `security_release_secctx`.
2020
pub struct SecurityCtx {
2121
ctx: bindings::lsm_context,
2222
}
@@ -67,9 +67,8 @@ impl SecurityCtx {
6767
impl Drop for SecurityCtx {
6868
#[inline]
6969
fn drop(&mut self) {
70-
// SAFETY: By the invariant of `Self`, this frees a context that came from a successful
71-
// call to `security_secid_to_secctx` and has not yet been destroyed by
72-
// `security_release_secctx`.
70+
// SAFETY: By the invariant of `Self`, this releases an lsm context that came from a
71+
// successful call to `security_secid_to_secctx` and has not yet been released.
7372
unsafe { bindings::security_release_secctx(&mut self.ctx) };
7473
}
7574
}

0 commit comments

Comments
 (0)