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: <c7d82c56-9632-4987-aadf-7df861a490d9@proton.me>
Date: Wed, 02 Oct 2024 19:04:42 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Danilo Krummrich <dakr@...nel.org>
Cc: ojeda@...nel.org, alex.gaynor@...il.com, wedsonaf@...il.com, boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com, a.hindborg@...sung.com, aliceryhl@...gle.com, akpm@...ux-foundation.org, daniel.almeida@...labora.com, faith.ekstrand@...labora.com, boris.brezillon@...labora.com, lina@...hilina.net, mcanal@...lia.com, zhiw@...dia.com, cjia@...dia.com, jhubbard@...dia.com, airlied@...hat.com, ajanulgu@...hat.com, lyude@...hat.com, linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v8 16/29] rust: alloc: implement kernel `Vec` type

On 02.10.24 17:20, Danilo Krummrich wrote:
> On Wed, Oct 02, 2024 at 03:02:18PM +0000, Benno Lossin wrote:
>> On 01.10.24 16:59, Danilo Krummrich wrote:
>>> `Vec` provides a contiguous growable array type with contents allocated
>>> with the kernel's allocators (e.g. `Kmalloc`, `Vmalloc` or `KVmalloc`).
>>>
>>> In contrast to Rust's stdlib `Vec` type, the kernel `Vec` type considers
>>> the kernel's GFP flags for all appropriate functions, always reports
>>> allocation failures through `Result<_, AllocError>` and remains
>>> independent from unstable features.
>>>
>>> Signed-off-by: Danilo Krummrich <dakr@...nel.org>
>>> ---
>>>  rust/kernel/alloc.rs      |   6 +
>>>  rust/kernel/alloc/kvec.rs | 637 ++++++++++++++++++++++++++++++++++++++
>>
>> Any reason against naming this `vec.rs`?
> 
> I think I didn't rename kvec.rs and kbox.rs because we'd need to escape "box" in
> various places, e.g. in rust/kernel/alloc.rs:
> 
> ```
> pub mod r#box;
> 
> pub use self::r#box::Box;
> pub use self::r#box::KBox;
> pub use self::r#box::VBox;
> pub use self::r#box::KVBox;
> ```

Yeah, that's why `std` uses `boxed.rs`.

> And it's a kernel specific implementation, so kbox.rs and kvec.rs still makes
> sense. :)

Fair.

---
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ