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: <DDZN5VK2OK1W.25NNI77Y315WW@nvidia.com>
Date: Tue, 04 Nov 2025 13:55:54 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Alexandre Courbot" <acourbot@...dia.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>, "Alice Ryhl" <aliceryhl@...gle.com>,
 "Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] rust: transmute: add `from_bytes_prefix` family
 of methods

On Sat Nov 1, 2025 at 10:41 PM JST, Alexandre Courbot wrote:
> The `from_bytes*` family of functions expect a slice of the exact same
> size as the requested type. This can be sometimes cumbersome for callers
> that deal with dynamic stream of data that needs to be manually cut
> before each invocation of `from_bytes`.
>
> To simplify such callers, introduce a new `from_bytes*_prefix` family of
> methods, which split the input slice at the index required for the
> equivalent `from_bytes` method to succeed, and return its result
> alongside with the remainder of the slice.
>
> This design is inspired by zerocopy's `try_*_from_prefix` family of
> methods.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> This patch was part of a minor Nova cleanup series [1], but since it
> requires attention from the core Rust team and is buried under other
> Nova patches, I am taking the freedom to send it separately for
> visibility.
>
> Since the originating series makes use of this, I hope to eventually
> merge it together with it, through the drm-rust tree.
>
> Thanks!
>
> [1] https://lore.kernel.org/all/20251029-nova-vbios-frombytes-v1-0-ac441ebc1de3@nvidia.com/

Rust core folks: if this looks ok to you, could I get an Acked-by to
take this through the drm-rust tree along with the rest of the series?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ