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: <a-h53UVYFV5_SzPX9oC8md8XoQLoabGTyT9utM2PavNqng5YUVxDRErEj5Eu19CZLmxQKc7rp1RiCmtaULw7mygUQ9cSUb5966WCLIQKwCQ=@protonmail.com>
Date: Wed, 28 May 2025 12:18:11 +0000
From: Pekka Ristola <pekkarr@...tonmail.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Jan Kara <jack@...e.cz>, 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>, linux-fsdevel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rust: file: mark `LocalFile` as `repr(transparent)`

On Wednesday, May 28th, 2025 at 13.52, Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:

> On Tue, May 27, 2025 at 10:49 PM Pekka Ristola <pekkarr@...tonmail.com> wrote:
> 
> > Unsafe code in `LocalFile`'s methods assumes that the type has the same
> > layout as the inner `bindings::file`. This is not guaranteed by the default
> > struct representation in Rust, but requires specifying the `transparent`
> > representation.
> > 
> > The `File` struct (which also wraps `bindings::file`) is already marked as
> > `repr(transparent)`, so this change makes their layouts equivalent.
> > 
> > Fixes: 851849824bb5 ("rust: file: add Rust abstraction for `struct file`")
> > Closes: https://github.com/Rust-for-Linux/linux/issues/1165
> > Signed-off-by: Pekka Ristola pekkarr@...tonmail.com
> 
> 
> Thanks Pekka, both patches look good to me. I will close the issue
> when Christian applies them (or if I should take them, that is good
> too).

Thanks, I'm glad it went smoothly since this was my first patch to the
mailing list.

Pekka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ