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: <20180125185330.GH10706@ziepe.ca>
Date:   Thu, 25 Jan 2018 11:53:30 -0700
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Doug Ledford <dledford@...hat.com>
Cc:     Davidlohr Bueso <dave@...olabs.net>, roland@...estorage.com,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH] IB/mthca: Fix how mthca_map_user_db() calls gup

On Thu, Jan 25, 2018 at 01:06:24PM -0500, Doug Ledford wrote:
> On Thu, 2018-01-25 at 10:50 -0700, Jason Gunthorpe wrote:
> > On Thu, Jan 25, 2018 at 11:34:23AM -0500, Doug Ledford wrote:
> > > > - Should I be wrong about no callers already holding mmap_sem,
> > > >   I still think calling gup without the mutex makes sense for
> > > >   improved paralellism. Now, if callers can hold the mmap_sem,
> > > >   it's wrong to do copy_from_user right before calling mthca_map_user_db.
> > > 
> > > So, if I understand you correctly, we (well, you and Al would be more
> > > correct, we haven't looked into the situation yet, so Mellanox people
> > > that worked on this in the day might now, or someone taking the time to
> > > research it could find out) don't have a clear understanding of all the
> > > conditions this function is called under, and so we actually don't know
> > > what the best way forward is to fix it?
> > 
> > I looked at it enough to be confident that mthca_map_user_db is never
> > called with mmap_sem held.
> > 
> > Also pretty confident that mthca_unmap_user_db is never called with
> > mmap_sem.
> > 
> > So how about just grabbing mmap_sem around the call to get_user_pages
> > and no other changes?
> 
> Since the original post was referred to an ABBA deadlock, wouldn't we
> have to drop db_tab->mutex, then grab both in the proper order?

I had understood that was only a concern because Davidlohr was having
trouble proving the callchain didn't include mmap_sem already..

I can see the call chain all ends on verbs ops, and I know verbs ops
with ucontext's are never called under mmap_sem by the core code..

Jason


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ