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: <70CF53DF-175E-4687-A719-6C992C69CC0A@collabora.com>
Date: Thu, 4 Dec 2025 07:32:09 -0600
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Carlos Llamas <cmllamas@...gle.com>,
 Steven Rostedt <rostedt@...dmis.org>,
 Masami Hiramatsu <mhiramat@...nel.org>,
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Miguel Ojeda <ojeda@...nel.org>,
 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>,
 Trevor Gross <tmgross@...ch.edu>,
 Danilo Krummrich <dakr@...nel.org>,
 Arve Hjønnevåg <arve@...roid.com>,
 Todd Kjos <tkjos@...roid.com>,
 Martijn Coenen <maco@...roid.com>,
 Joel Fernandes <joelagnelf@...dia.com>,
 Christian Brauner <brauner@...nel.org>,
 Suren Baghdasaryan <surenb@...gle.com>,
 rust-for-linux@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rust: sync: add Arc::DATA_OFFSET



> On 3 Dec 2025, at 08:48, Alice Ryhl <aliceryhl@...gle.com> wrote:
> 
> This constant will be used to expose some offset constants from the Rust
> Binder driver to tracepoints which are implemented in C. The constant is
> usually equal to sizeof(refcount_t), but may be larger if T has a large
> alignment.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
> ---
> rust/kernel/sync/arc.rs | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs
> index 289f77abf415a2a52e039a2c0291413eda01217c..921e19333b895f0d971591c4753047d0248a3029 100644
> --- a/rust/kernel/sync/arc.rs
> +++ b/rust/kernel/sync/arc.rs
> @@ -240,6 +240,9 @@ pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> {
>         // `Arc` object.
>         Ok(unsafe { Self::from_inner(inner) })
>     }
> +
> +    /// The offset that the value is stored at.
> +    pub const DATA_OFFSET: usize = core::mem::offset_of!(ArcInner<T>, data);
> }
> 
> impl<T: ?Sized> Arc<T> {
> 
> -- 
> 2.52.0.158.g65b55ccf14-goog
> 
> 


Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ