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: <b7e8b816-a3c1-454c-bf97-516bf78c697c@proton.me>
Date: Fri, 26 Jul 2024 13:36:57 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Andrew Morton <akpm@...ux-foundation.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>, Andreas Hindborg <a.hindborg@...sung.com>, linux-kernel@...r.kernel.org, linux-mm@...ck.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: mm: add abstractions for mm_struct and vm_area_struct

On 26.07.24 10:32, Alice Ryhl wrote:
> On Fri, Jul 26, 2024 at 10:11 AM Benno Lossin <benno.lossin@...ton.me> wrote:
>>
>> On 23.07.24 16:32, Alice Ryhl wrote:
>>> This is a follow-up to the page abstractions [1] that were recently
>>> merged in 6.11. Rust Binder will need these abstractions to manipulate
>>> the vma in its implementation of the mmap fop on the Binder file.
>>>
>>> The ARef wrapper is not used for mm_struct because there are several
>>> different types of refcounts.
>>
>> I am confused, why can't you use the `ARef` wrapper for the different
>> types that you create below?
> 
> Well, maybe I can, but it means we have several wrapper structs of
> Opaque<mm_struct>. Would it not be confusing? Could you suggest a
> naming scheme for the structs I should have?

I don't know of a good way to avoid that, IMO your current
implementation has the same issue (multiple wrappers). So I don't think
it's that bad to have multiple wrappers for one C struct.
We could also use generics to solve this, right? I am not sure about the
ergonomics/looks, so for example:
- ARef<Mm<Grab>>
- ARef<Mm<Get>>
- ARef<Mm<Async>>

I think it looks fine, then you also only have one struct wrapper.

BTW what does "mm" stand for? Memory management?

---
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ