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: <20230615044015.GA4720@lst.de>
Date:   Thu, 15 Jun 2023 06:40:15 +0200
From:   Christoph Hellwig <hch@....de>
To:     Damien Le Moal <dlemoal@...nel.org>
Cc:     Alan Stern <stern@...land.harvard.edu>,
        Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>,
        Joe Breuer <linux-kernel@...reuer.net>,
        Bart Van Assche <bvanassche@....org>,
        Bagas Sanjaya <bagasdotme@...il.com>,
        Pavel Machek <pavel@....cz>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <len.brown@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kees Cook <keescook@...omium.org>,
        Tony Luck <tony.luck@...el.com>,
        "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
        Thorsten Leemhuis <linux@...mhuis.info>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Phillip Potter <phil@...lpotter.co.uk>,
        Linux Power Management <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Hardening <linux-hardening@...r.kernel.org>,
        Linux Regressions <regressions@...ts.linux.dev>,
        Linux SCSI <linux-scsi@...r.kernel.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Hannes Reinecke <hare@...e.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Martin Kepplinger <martin.kepplinger@...i.sm>,
        Kai-Heng Feng <kai.heng.feng@...onical.com>
Subject: Re: Fwd: Waking up from resume locks up on sr device

On Thu, Jun 15, 2023 at 09:10:28AM +0900, Damien Le Moal wrote:
> > Here's what commit e27829dc92e5 ("scsi: serialize ->rescan against 
> > ->remove", written by Christoph Hellwig) says:
> > 
> >     Lock the device embedded in the scsi_device to protect against
> >     concurrent calls to ->remove.
> > 
> > That's the commit which added the device_lock() call.
> 
> Thanks for the information.
> 
> +Christoph
> 
> Why is adding the device_lock() needed ? We could just do a
> scsi_device_get()+scsi_device_put() to serialize against remove. No ?

No.  scsi_device_get just increments a reference count, and thus
prevents ->release from beeing called.  ->remove is not in any way
affected by the refcount.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ