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

From: Alice Ryhl

Date: Thu Sep 10 2026 - 11:40:34 EST


On Fri, Aug 28, 2026 at 4:44 AM Nils Lehnen <nils.lehnen@xxxxxxxxx> wrote:
>
> From: Benno Lossin <lossin@xxxxxxxxxx>
>
> 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@xxxxxxxxxx
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Signed-off-by: Benno Lossin <lossin@xxxxxxxxxx>
> Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> Signed-off-by: Nils Lehnen <nils.lehnen@xxxxxxxxx>

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>