[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e0be6c3f-7b9f-4116-9237-3f5715e21516@proton.me>
Date: Fri, 19 Jan 2024 09:41:15 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Alice Ryhl <aliceryhl@...gle.com>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Andreas Hindborg <a.hindborg@...sung.com>, Peter Zijlstra <peterz@...radead.org>, Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Arve Hjønnevåg <arve@...roid.com>, Todd Kjos <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>, Joel Fernandes <joel@...lfernandes.org>, Carlos Llamas <cmllamas@...gle.com>, Suren Baghdasaryan <surenb@...gle.com>
Cc: Dan Williams <dan.j.williams@...el.com>, Kees Cook <keescook@...omium.org>, Matthew Wilcox <willy@...radead.org>, Thomas Gleixner <tglx@...utronix.de>, Daniel Xu <dxu@...uu.xyz>, linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3 3/9] rust: security: add abstraction for secctx
On 1/18/24 15:36, Alice Ryhl wrote:
> Adds an abstraction for viewing the string representation of a security
> context.
>
> This is needed by Rust Binder because it has feature where a process can
> view the string representation of the security context for incoming
> transactions. The process can use that to authenticate incoming
> transactions, and since the feature is provided by the kernel, the
> process can trust that the security context is legitimate.
>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
I have one nit below, with that fixed:
Reviewed-by: Benno Lossin <benno.lossin@...ton.me>
> +impl Drop for SecurityCtx {
> + fn drop(&mut self) {
> + // SAFETY: This frees a pointer that came from a successful call to
I would add this to the beginning:
By the invariant of `Self`, this frees ...
--
Cheers,
Benno
> + // `security_secid_to_secctx` and has not yet been destroyed by `security_release_secctx`.
> + unsafe { bindings::security_release_secctx(self.secdata, self.seclen as u32) };
> + }
> +}
> --
> 2.43.0.381.gb435a96ce8-goog
>
Powered by blists - more mailing lists