[PATCH] rust: security: replace `core::mem::zeroed` with `pin_init::zeroed`

Alice Ryhl aliceryhl at google.com
Thu Sep 10 15:15:21 UTC 2026


On Fri, Aug 28, 2026 at 4:44 AM Nils Lehnen <nils.lehnen at proton.me> wrote:
>
> From: Benno Lossin <lossin at kernel.org>
>
> All types in `bindings` implement `Zeroable` if they can, so use
> `pin_init::zeroed` instead of relying on `unsafe` code.
>
> If this ends up not compiling in the future, something in bindgen or on
> the C side changed and is most likely incorrect.
>
> Link: https://lore.kernel.org/r/20250814093046.2071971-8-lossin@kernel.org
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Signed-off-by: Benno Lossin <lossin at kernel.org>
> Reviewed-by: Alexandre Courbot <acourbot at nvidia.com>
> Signed-off-by: Nils Lehnen <nils.lehnen at proton.me>

Reviewed-by: Alice Ryhl <aliceryhl at google.com>



More information about the Linux-security-module-archive mailing list