Files
linux/rust/kernel
Benno Lossin df27cef153 rust: init: fix Zeroable implementation for Option<NonNull<T>> and Option<KBox<T>>
According to [1], `NonNull<T>` and `#[repr(transparent)]` wrapper types
such as our custom `KBox<T>` have the null pointer optimization only if
`T: Sized`. Thus remove the `Zeroable` implementation for the unsized
case.

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1]
Reported-by: Alice Ryhl <aliceryhl@google.com>
Closes: https://lore.kernel.org/rust-for-linux/CAH5fLghL+qzrD8KiCF1V3vf2YcC6aWySzkmaE2Zzrnh1gKj-hw@mail.gmail.com/
Cc: stable@vger.kernel.org # v6.12+ (a custom patch will be needed for 6.6.y)
Fixes: 38cde0bd7b ("rust: init: add `Zeroable` trait and `init::zeroed` function")
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250305132836.2145476-1-benno.lossin@proton.me
[ Added Closes tag and moved up the Reported-by one. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-03-05 23:57:39 +01:00
..
2024-09-30 13:02:29 +02:00
2025-02-13 16:58:58 +01:00
2024-12-20 17:19:26 +01:00
2024-12-20 17:21:04 +01:00
2024-10-08 15:44:36 +02:00
2024-12-16 21:49:33 +01:00
2024-12-20 17:19:26 +01:00
2024-11-26 17:54:58 -08:00
2024-11-10 23:58:00 +01:00
2024-11-04 16:21:44 -05:00