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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150527083933.GA13844@kuha.fi.intel.com>
Date:	Wed, 27 May 2015 11:39:33 +0300
From:	Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Tal Shorer <tal.shorer@...il.com>,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	USB list <linux-usb@...r.kernel.org>,
	"<linux-kernel@...r.kernel.org>" <linux-kernel@...r.kernel.org>,
	David Cohen <david.a.cohen@...ux.intel.com>,
	Felipe Balbi <balbi@...com>,
	Lu Baolu <baolu.lu@...ux.intel.com>
Subject: Re: [PATCH] usb: ulpi: don't register drivers if bus doesn't exist

Hi Greg,

> > But couldn't we add a helper function to drivers/base/bus.c that the
> > bus drivers can use to at least check was the bus already loaded or
> > not? It looks like there are a couple of bus drivers that use the
> > struct bus member "p" to check that.
> > 
> > Greg, what do you think?
> 
> I think your design is wrong if you need to worry about this :)

This problem is not ulpi specific. We have the same issue with every
single bus. With a bus like PCI it's just really unlikely to hit it
because PCI bus driver uses postcore_initcall. But if there was
a PCI driver that used postcore_initcall itself, maybe a gpio
controller driver for example, exactly the same panic would happen
that we see happening when a driver tries to register itself with ulpi
bus before ulpi bus has been registered.

I can appreciate now that fixing the core problem like I2C did is
wrong, but I still feel that the driver core should provide something
like the helper for checking if the bus was registered already or not.
Otherwise all the bus drivers should really have a variable like Sudip
suggested for checking it, but that would be boilerplate, no?


Thanks,

-- 
heikki
--
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