Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-10-01 Thread Jann Horn
On Fri, Oct 2, 2020 at 1:41 AM Jason Gunthorpe wrote: > On Thu, Oct 01, 2020 at 10:16:35PM +0200, Jann Horn wrote: > > > A subclass isn't right, it has to be a _nested annotation. > > > > > > nested locking is a pretty good reason to not be able to do this, this > > > is something lockdep does

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-10-01 Thread Jason Gunthorpe
On Thu, Oct 01, 2020 at 10:16:35PM +0200, Jann Horn wrote: > > A subclass isn't right, it has to be a _nested annotation. > > > > nested locking is a pretty good reason to not be able to do this, this > > is something lockdep does struggle to model. > > Did I get the terminology wrong? I thought

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-10-01 Thread Jann Horn
On Thu, Oct 1, 2020 at 9:15 PM Jason Gunthorpe wrote: > On Thu, Oct 01, 2020 at 01:51:33AM +0200, Jann Horn wrote: > > On Thu, Oct 1, 2020 at 1:26 AM Jason Gunthorpe wrote: > > > On Wed, Sep 30, 2020 at 10:14:57PM +0200, Jann Horn wrote: > > > > On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote:

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-10-01 Thread Jason Gunthorpe
On Thu, Oct 01, 2020 at 01:51:33AM +0200, Jann Horn wrote: > On Thu, Oct 1, 2020 at 1:26 AM Jason Gunthorpe wrote: > > On Wed, Sep 30, 2020 at 10:14:57PM +0200, Jann Horn wrote: > > > On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote: > > > > On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote:

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Jann Horn
On Thu, Oct 1, 2020 at 1:26 AM Jason Gunthorpe wrote: > On Wed, Sep 30, 2020 at 10:14:57PM +0200, Jann Horn wrote: > > On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote: > > > On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote: > > > > On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote:

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Michel Lespinasse
On Wed, Sep 30, 2020 at 1:15 PM Jann Horn wrote: > On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote: > > On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote: > > > On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote: > > > > In preparation for adding a mmap_assert_locked() check in > > >

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Jason Gunthorpe
On Wed, Sep 30, 2020 at 10:14:57PM +0200, Jann Horn wrote: > On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote: > > On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote: > > > On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote: > > > > In preparation for adding a mmap_assert_locked() check

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Jann Horn
On Wed, Sep 30, 2020 at 2:50 PM Jann Horn wrote: > On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote: > > On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote: > > > In preparation for adding a mmap_assert_locked() check in > > > __get_user_pages(), teach the mmap_assert_*locked()

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Jann Horn
On Wed, Sep 30, 2020 at 2:30 PM Jason Gunthorpe wrote: > On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote: > > In preparation for adding a mmap_assert_locked() check in > > __get_user_pages(), teach the mmap_assert_*locked() helpers that it's fine > > to operate on an mm without locking

Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-30 Thread Jason Gunthorpe
On Tue, Sep 29, 2020 at 06:20:00PM -0700, Jann Horn wrote: > In preparation for adding a mmap_assert_locked() check in > __get_user_pages(), teach the mmap_assert_*locked() helpers that it's fine > to operate on an mm without locking in the middle of execve() as long as > it hasn't been installed

[PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet

2020-09-29 Thread Jann Horn
In preparation for adding a mmap_assert_locked() check in __get_user_pages(), teach the mmap_assert_*locked() helpers that it's fine to operate on an mm without locking in the middle of execve() as long as it hasn't been installed on a process yet. Existing code paths that do this are (reverse