lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DEMKGE8GI716.EVHQMIKCKQKX@nvidia.com>
Date: Mon, 01 Dec 2025 12:39:54 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Atharv Dubey" <atharvd440@...il.com>, <paul@...l-moore.com>,
 <jmorris@...ei.org>, <serge@...lyn.com>, <ojeda@...nel.org>,
 <alex.gaynor@...il.com>
Cc: <boqun.feng@...il.com>, <gary@...yguo.net>, <bjorn3_gh@...tonmail.com>,
 <lossin@...nel.org>, <a.hindborg@...nel.org>, <aliceryhl@...gle.com>,
 <tmgross@...ch.edu>, <dakr@...nel.org>,
 <linux-security-module@...r.kernel.org>, <rust-for-linux@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rust: security: use `pin_init::zeroed()` for LSM
 context initialization

On Sat Nov 29, 2025 at 10:56 PM JST, Atharv Dubey wrote:
> Replace the previous `unsafe { core::mem::zeroed() }` initialization of
> `bindings::lsm_context` with `pin_init::zeroed()`.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Signed-off-by: Atharv Dubey <atharvd440@...il.com>
> ---
>  rust/kernel/security.rs | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/rust/kernel/security.rs b/rust/kernel/security.rs
> index 9d271695265f..4dc3eba6ce84 100644
> --- a/rust/kernel/security.rs
> +++ b/rust/kernel/security.rs
> @@ -62,8 +62,7 @@ impl SecurityCtx {
>      /// Get the security context given its id.
>      #[inline]
>      pub fn from_secid(secid: u32) -> Result<Self> {
> -        // SAFETY: `struct lsm_context` can be initialized to all zeros.
> -        let mut ctx: bindings::lsm_context = unsafe { core::mem::zeroed() };
> +        let mut ctx: bindings::lsm_context = pin_init::zeroed();

Reviewed-by: Alexandre Courbot <acourbot@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ