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: <a7f91ee5-ecd4-4446-9de7-3902763c0058@suse.de>
Date: Tue, 27 Feb 2024 11:05:22 +0100
From: Carlos López <clopez@...e.de>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: 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>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
 Christian Brauner <brauner@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
 Alex Gaynor <alex.gaynor@...il.com>,
 Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng
 <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>,
 Benno Lossin <benno.lossin@...ton.me>,
 Andreas Hindborg <a.hindborg@...sung.com>, Kees Cook
 <keescook@...omium.org>, Al Viro <viro@...iv.linux.org.uk>,
 Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 1/4] rust: uaccess: add userspace pointers


On 8/2/24 16:47, Alice Ryhl wrote:
> +    /// Create a reader that can access the same range of data.
> +    ///
> +    /// Reading from the clone does not advance the current reader.
> +    ///
> +    /// The caller should take care to not introduce TOCTOU issues, as described
> +    /// in the documentation for [`UserSlice`].
> +    pub fn clone_reader(&self) -> UserSliceReader {
> +        UserSliceReader {
> +            ptr: self.ptr,
> +            length: self.length,
> +        }
> +    }

Just out of curiosity, is there any reason why this is not implemented
in terms of the Clone trait?

-- 
Carlos López
Security Engineer
SUSE Software Solutions

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ