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, 10 May 2012 11:16:11 -0700
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Stephen Warren <swarren@...dotorg.org>
Cc:	Hiroshi DOYU <hdoyu@...dia.com>, linux-tegra@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC 1/1] Driver Core: don't oops with unregistered driver in
 driver_find_device()

On Thu, May 10, 2012 at 09:59:15AM -0600, Stephen Warren wrote:
> On 05/10/2012 08:11 AM, Greg Kroah-Hartman wrote:
> > On Thu, May 10, 2012 at 10:35:02AM +0300, Hiroshi DOYU wrote:
> >> driver_find_device() can be called with an unregistered driver.
> > 
> > Who does that?  Where in the kernel?  Why would you try to do that?
> > 
> >> Need to check driver_private to see if it's populated or not,
> >> especially under deferrable probe.
> > 
> > Hm, I don't know if this will really catch a driver that was registered
> > and then was unregistered, right?  It seems like moving the real problem
> > somewhere else, why not fix the original issue instead?
> > 
> >> Signed-off-by: Hiroshi DOYU <hdoyu@...dia.com>
> >> ---
> >> In [PATCHv5 2/3] ARM: tegra: Add SMMU enabler in AHB:
> >>   http://article.gmane.org/gmane.linux.ports.tegra/4658
> >>
> >> "tegra_ahb_driver" may not be populated when it's called.
> > 
> > It can?  I don't see that in that patch.
> 
> I think this is what's happening:
> 
> The Tegra SMMU driver is registered using subsys_initcall().
> 
> The Tegra AHB driver is registered using module_platform_driver, so
> module_init().
> 
> The device objects for both are registered at basically the same time
> during the machine's initialization call, which I think happens before
> both or some of the above two calls.
> 
> So, SMMU ends up getting probed before the AHB driver has even been
> registered.

What do those two drivers have to do with each other?

> That's why in patch Hiroshi linked, in tegra_ahb_enable_smmu(), the AHB
> driver hasn't (or may not have) been registered, so driver_find_device()
> can experience the issue this patch attempts to solve.

It sounds like you have a locking or ordering problem somewhere in this
platform, and it needs to be resolved there.  Odds are, this tiny check
is the least of your worries, right?

Who is doing the driver_find_device() call in the first place?  The
driver core?  Or something else?

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ