[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: df27cef153603b18a7d094b53cc3d5264ff32797
WARNING: Author mismatch between patch and upstream commit: Backport author: Miguel Ojedaojeda@kernel.org Commit author: Benno Lossinbenno.lossin@proton.me
Status in newer kernel trees: 6.13.y | Present (different SHA1: 1a1d0545f7a5) 6.12.y | Present (different SHA1: 0d876a8ae2cb)
Note: The patch differs from the upstream commit: --- 1: df27cef153603 ! 1: f87fa26b09a1f rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<KBox<T>>` @@ Metadata Author: Benno Lossin benno.lossin@proton.me
## Commit message ## - rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<KBox<T>>` + rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<Box<T>>` + + commit df27cef153603b18a7d094b53cc3d5264ff32797 upstream.
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. + such as `Box<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 @@ rust/kernel/init.rs: macro_rules! impl_zeroable { - // - // In this case we are allowed to use `T: ?Sized`, since all zeros is the `None` variant. - {<T: ?Sized>} Option<NonNull<T>>, -- {<T: ?Sized>} Option<KBox<T>>, +- {<T: ?Sized>} Option<Box<T>>, + {<T>} Option<NonNull<T>>, -+ {<T>} Option<KBox<T>>, ++ {<T>} Option<Box<T>>,
// SAFETY: `null` pointer is valid. // ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |