lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DFLOBHX35RHF.2T8D93SHY7QGX@kernel.org>
Date: Sun, 11 Jan 2026 11:04:53 +0100
From: "Benno Lossin" <lossin@...nel.org>
To: "Gary Guo" <gary@...yguo.net>, "Miguel Ojeda" <ojeda@...nel.org>, "Boqun
 Feng" <boqun.feng@...il.com>, Björn Roy Baron
 <bjorn3_gh@...tonmail.com>, "Andreas Hindborg" <a.hindborg@...nel.org>,
 "Alice Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>,
 "Danilo Krummrich" <dakr@...nel.org>, "Fiona Behrens" <me@...enk.dev>,
 "Christian Schrefl" <chrisi.schrefl@...il.com>, "Alban Kurti"
 <kurti@...icto.ai>
Cc: <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH 08/12] rust: pin-init: rewrite the initializer macros
 using `syn`

On Sun Jan 11, 2026 at 2:10 AM CET, Gary Guo wrote:
> On Sat Jan 10, 2026 at 11:18 PM GMT, Benno Lossin wrote:
>> On Sat Jan 10, 2026 at 8:20 PM CET, Gary Guo wrote:
>>> On Sat Jan 10, 2026 at 6:14 PM GMT, Benno Lossin wrote:
>>>> On Fri Jan 9, 2026 at 2:45 PM CET, Gary Guo wrote:
>>>>> On Thu Jan 8, 2026 at 1:50 PM GMT, Benno Lossin wrote:
>>>>>> +                quote! {
>>>>>> +                    {
>>>>>> +                        #value_prep
>>>>>> +                        // SAFETY: TODO
>>>>>> +                        unsafe { #write(::core::ptr::addr_of_mut!((*#slot).#ident), #value_ident) };
>>>>>
>>>>> This should be `&raw mut` now?
>>>>
>>>> Yes, but that involves adding workarounds for 1.81 and earlier. I'll
>>>> leave it for a future series.
>>>
>>> You can just enable `raw_ref_op` feature globally. We've already enabled it for
>>> the kernel crate.
>>
>> It must be possible to compile the pin-init crate using a stable
>> compiler.
>
> pin-init crate just need to use the feature without any source code change.
> Enabling can be done from Makefile.

The tests as well as the examples need the workaround. Since we use
`#[test]` in `src/__internal.rs` we also need it in `src/lib.rs`.

> In fact, in e1dfaa33fd2d (rust: enable `raw_ref_op` feature) it has already been
> globally enabled for driver crates. You just might need to explicitly enable it
> for pin-init in rust/Makefile.

It's not about the kernel, but the user-land crate.

>> Enabling an already stable feature still causes a compiler
>> error (last time I checked). So we unfortunately can't enable it without
>> workarounds.
>
> stable_features is a lint that is globally allowed in our Makefile.

That's not enough, you still get an error on stable:

    https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=854ab9c0ffb47d78c9f9e6012deaf821

Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ