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]
Date: Thu, 25 Apr 2024 17:20:18 +0100
From: Gary Guo <gary@...yguo.net>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Benno Lossin <benno.lossin@...ton.me>, Alice Ryhl
 <aliceryhl@...gle.com>, Miguel Ojeda <ojeda@...nel.org>, Matthew Wilcox
 <willy@...radead.org>, Al Viro <viro@...iv.linux.org.uk>, Andrew Morton
 <akpm@...ux-foundation.org>, Kees Cook <keescook@...omium.org>, Alex Gaynor
 <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, Andreas Hindborg
 <a.hindborg@...sung.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Arve Hjønnevåg <arve@...roid.com>, Todd Kjos
 <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>, Joel Fernandes
 <joel@...lfernandes.org>, Carlos Llamas <cmllamas@...gle.com>, Suren
 Baghdasaryan <surenb@...gle.com>, Arnd Bergmann <arnd@...db.de>, Trevor
 Gross <tmgross@...ch.edu>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, Christian
 Brauner <brauner@...nel.org>
Subject: Re: [PATCH v6 4/4] rust: add abstraction for `struct page`

On Thu, 18 Apr 2024 15:56:11 -0700
Boqun Feng <boqun.feng@...il.com> wrote:
 
> Hmm.. here is the thing, having `&UnsafeCell<[u8]>` means having a `*mut
> [u8]>`, and it should always be safe to get a "length" of `*mut [u8]`,  
> right? I haven't found any method doing that, but the length should be
> just a part of fat pointer, so I think getting that is a defined
> behavior. But maybe I'm missing something.

You can just use `unsafe_cell.get().len()`. `len` method exists on
raw slice pointers, gated by the `slice_ptr_len` feature, which will
be stable in 1.79.0.

Best,
Gary

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ