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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4db9dae5f659512146bd441cf2edf5a4aca16b93.camel@mailbox.org>
Date: Tue, 18 Nov 2025 09:30:45 +0100
From: Philipp Stanner <phasta@...lbox.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>, Philipp Stanner
	 <phasta@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
 Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, Benno Lossin
 <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl
 <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich
 <dakr@...nel.org>, Tamir Duberstein <tamird@...il.com>, Christian Schrefl
 <chrisi.schrefl@...il.com>,  rust-for-linux@...r.kernel.org,
 linux-kernel@...r.kernel.org,  stable@...r.kernel.org
Subject: Re: [PATCH v2] rust: list: Add unsafe for container_of

On Tue, 2025-11-18 at 09:20 +0100, Miguel Ojeda wrote:
> On Tue, Nov 18, 2025 at 8:29 AM Philipp Stanner <phasta@...nel.org> wrote:
> > 
> > For unknown reasons, that problem was so far not visible and only gets
> > visible once one utilizes the list implementation from within the core
> > crate:
> 
> What do you mean by "unknown reasons"? The reason is known -- please
> refer to my message in the other thread. It should be mentioned in the
> log, including the link to the compiler issue.

OK.

> 
> Also, I assume you meant `kernel` crate, not `core`.
> 
> > Cc: stable@...r.kernel.org # v6.17+
> 
> No need to mention the kernel version if the Fixes tags implies it. In
> fact, it is more confusing, since it looks like there is a version
> where it should not be applied to.

It's absolutely common to provide it. If you feel better without it, I
can omit it, I guess.

> 
> > -                let container = $crate::container_of!(
> > +                let container = unsafe { $crate::container_of!(
> >                      links_field, $crate::list::ListLinksSelfPtr<Self, $num>, inner
> > -                );
> > +                ) };
> 
> Unsafe blocks require `// SAFETY: ...` comments.

Ah, right. Overlooked that because the other section already has one.

> 
> Also, please double-check if this is the formatting that `rustfmt` would use.

I ran rustfmt.


P.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ