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: <ab86d283-7393-4b11-b08b-ced744de7f82@lucifer.local>
Date: Thu, 5 Dec 2024 10:45:27 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Matthew Wilcox <willy@...radead.org>,
        Vlastimil Babka <vbabka@...e.cz>, John Hubbard <jhubbard@...dia.com>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>, Christian Brauner <brauner@...nel.org>,
        Jann Horn <jannh@...gle.com>, Suren Baghdasaryan <surenb@...gle.com>,
        Alex Gaynor <alex.gaynor@...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@...nel.org>,
        Trevor Gross <tmgross@...ch.edu>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v10 2/8] mm: rust: add vm_area_struct methods that
 require read access

On Thu, Dec 05, 2024 at 11:40:03AM +0100, Alice Ryhl wrote:
> On Fri, Nov 29, 2024 at 5:32 PM Alice Ryhl <aliceryhl@...gle.com> wrote:
> >
> > This adds a type called VmAreaRef which is used when referencing a vma
> > that you have read access to. Here, read access means that you hold
> > either the mmap read lock or the vma read lock (or stronger).
> >
> > Additionally, a vma_lookup method is added to the mmap read guard, which
> > enables you to obtain a &VmAreaRef in safe Rust code.
> >
> > This patch only provides a way to lock the mmap read lock, but a
> > follow-up patch also provides a way to just lock the vma read lock.
> >
> > Acked-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com> (for mm bits)
> > Reviewed-by: Jann Horn <jannh@...gle.com>
> > Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
>
> It looks like binder needs a way to check whether a given vma is
> associated with a given mm. I guess we can do that by adding a method
> to VmAreaRef that returns a &MmWithUser.

Presumably this would be with a lock held to ensure the VMA doesn't
disappear from under us?

I guess that's implied by possessing a VmAreaRef in the first place.

I also suppoes that the mm having users is implied by you having the VMA
that implies a lock held on it :)

So that's probably fine then, as long as you can implement some sensible
means of comparison between a known 'given mm' vs. the &MmWithUser.

>
> This indicates that vma->vm_mm references an mm with non-zero mm_users
> whenever it's legal to have a reference to the vma.
>
> Alice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ