Re: [PATCH v3 2/9] rust: cred: add Rust abstraction for `struct cred`

From: Alice Ryhl
Date: Fri Jan 19 2024 - 04:53:43 EST


On Fri, Jan 19, 2024 at 10:37 AM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
> On 1/18/24 15:36, Alice Ryhl wrote:
> > + /// Returns the effective UID of the given credential.
> > + pub fn euid(&self) -> bindings::kuid_t {
> > + // SAFETY: By the type invariant, we know that `self.0` is valid.
>
> Is `euid` an immutable property, or why does this memory access not race
> with something?

Yes. These properties are changed by replacing the credential, so the
credentials themselves are immutable.

Alice