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:   Fri, 11 Aug 2017 12:28:57 -0300
From:   Henrique de Moraes Holschuh <hmh@....eng.br>
To:     Michal Suchánek <msuchanek@...e.de>
Cc:     Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Peter Huewe <peterhuewe@....de>,
        Marcel Selhorst <tpmdd@...horst.net>,
        Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        linux-kernel@...r.kernel.org, tpmdd-devel@...ts.sourceforge.net
Subject: Re: [PATCH] Do not disable driver and bus shutdown hook when class
 shutdown hook is set.

On Fri, 11 Aug 2017, Michal Suchánek wrote:
> On 2017-08-10 18:30, Jason Gunthorpe wrote:
> > On Thu, Aug 10, 2017 at 12:18:11PM +0200, Michal Suchánek wrote:
> > > > Existing bus implementations do properly chain to driver shutdown (eg
> > > > look at mmc_bus_shutdown) and it appears to have been written like
> > > 
> > > Neither isa nor ibmebus does. These are two random buses I tried to
> > > look at.
> > 
> > I'm not following, I see this:
> > 
> > static void ibmebus_bus_device_shutdown(struct device *dev)
> > {
> >         struct platform_device *of_dev = to_platform_device(dev);
> >         struct platform_driver *drv = to_platform_driver(dev->driver);
> > 
> >         if (dev->driver && drv->shutdown)
> >                 drv->shutdown(of_dev);
> > }
> > 
> > It looks to me like in this case the struct device_driver shutdown is
> > not used, and instead the struct platform_driver shutdown is called.
> 
> And it is not used even if a device driver sets it and expects it to run.

Which is the kind of landmine it is best avoided in drivers/, so it
would be nice to get WARN_ON() during device register when
dev->shutdown() methods *that are going to be ignored* because of
class/bus handlers are non-NULL...

Either that, or the device->shutdown() methods should always be called,
and drivers that should not/need not have them should be fixed...

-- 
  Henrique Holschuh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ