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]
Date:   Thu, 20 Feb 2020 15:27:43 -0400
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     "Ertman, David M" <david.m.ertman@...el.com>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "nhorman@...hat.com" <nhorman@...hat.com>,
        "sassmann@...hat.com" <sassmann@...hat.com>,
        "parav@...lanox.com" <parav@...lanox.com>,
        "galpress@...zon.com" <galpress@...zon.com>,
        "selvin.xavier@...adcom.com" <selvin.xavier@...adcom.com>,
        "sriharsha.basavapatna@...adcom.com" 
        <sriharsha.basavapatna@...adcom.com>,
        "benve@...co.com" <benve@...co.com>,
        "bharat@...lsio.com" <bharat@...lsio.com>,
        "xavier.huwei@...wei.com" <xavier.huwei@...wei.com>,
        "yishaih@...lanox.com" <yishaih@...lanox.com>,
        "leonro@...lanox.com" <leonro@...lanox.com>,
        "mkalderon@...vell.com" <mkalderon@...vell.com>,
        "aditr@...are.com" <aditr@...are.com>,
        "Patil, Kiran" <kiran.patil@...el.com>,
        "Bowers, AndrewX" <andrewx.bowers@...el.com>
Subject: Re: [RFC PATCH v4 01/25] virtual-bus: Implementation of Virtual Bus

On Thu, Feb 20, 2020 at 06:55:28PM +0000, Ertman, David M wrote:
> > From: Greg KH <gregkh@...uxfoundation.org>
> > Sent: Friday, February 14, 2020 12:45 PM
> > To: Jason Gunthorpe <jgg@...pe.ca>
> > Cc: Kirsher, Jeffrey T <jeffrey.t.kirsher@...el.com>; davem@...emloft.net;
> > Ertman, David M <david.m.ertman@...el.com>; netdev@...r.kernel.org;
> > linux-rdma@...r.kernel.org; nhorman@...hat.com;
> > sassmann@...hat.com; parav@...lanox.com; galpress@...zon.com;
> > selvin.xavier@...adcom.com; sriharsha.basavapatna@...adcom.com;
> > benve@...co.com; bharat@...lsio.com; xavier.huwei@...wei.com;
> > yishaih@...lanox.com; leonro@...lanox.com; mkalderon@...vell.com;
> > aditr@...are.com; Patil, Kiran <kiran.patil@...el.com>; Bowers, AndrewX
> > <andrewx.bowers@...el.com>
> > Subject: Re: [RFC PATCH v4 01/25] virtual-bus: Implementation of Virtual Bus
> > 
> > On Fri, Feb 14, 2020 at 04:34:55PM -0400, Jason Gunthorpe wrote:
> > > On Fri, Feb 14, 2020 at 09:02:40AM -0800, Greg KH wrote:
> > > > > +	put_device(&vdev->dev);
> > > > > +	ida_simple_remove(&virtbus_dev_ida, vdev->id);
> > > >
> > > > You need to do this before put_device().
> > >
> > > Shouldn't it be in the release function? The ida index should not be
> > > re-used until the kref goes to zero..
> 
> The IDA should not be reused until the virtbus_device is unregistered.  We
> don't want another device with the same name and same IDA to be
> registered,

Unregistration of the virtbus_device always happens before release.

release is the point when the kref goes to zero and you can be
confident there are no other threads reading the index or the device
name.

Remember, the put_device() above is not guarenteed to be the one that
calls to release..

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ