Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Miguel Ojeda <ojeda@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.6.y] rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<Box<T>>`
Date: Mon, 17 Mar 2025 08:24:11 -0400	[thread overview]
Message-ID: <20250316145020-a2ad4bf4b590b564@stable.kernel.org> (raw)
In-Reply-To: <20250316160935.2407908-1-ojeda@kernel.org>

[ 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 Ojeda<ojeda@kernel.org>
Commit author: Benno Lossin<benno.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   |

      parent reply	other threads:[~2025-03-17 12:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-16  7:16 FAILED: patch "[PATCH] rust: init: fix `Zeroable` implementation for" failed to apply to 6.6-stable tree gregkh
2025-03-16 16:09 ` [PATCH 6.6.y] rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<Box<T>>` Miguel Ojeda
2025-03-16 16:13   ` Miguel Ojeda
2025-03-16 16:32     ` Greg KH
2025-03-17 18:21       ` Miguel Ojeda
2025-03-17 20:24         ` Greg KH
2025-03-17 20:39           ` Miguel Ojeda
2025-03-17 20:54             ` Miguel Ojeda
2025-03-18 13:21               ` Greg KH
2025-03-17 12:24   ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250316145020-a2ad4bf4b590b564@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox