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:	Mon, 9 Jan 2012 12:01:49 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
cc:	Greg KH <greg@...ah.com>, Kay Sievers <kay.sievers@...y.org>,
	USB list <linux-usb@...r.kernel.org>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: Problems with get_driver() and driver_attach() (and new_id too)

On Mon, 9 Jan 2012, Dmitry Torokhov wrote:

> > > drivers/ssb/main.c seems like needs some protection but does it
> > > incorrectly as we do not wait for drivers to drop all references before
> > > unloading modules.
> > 
> > Possibly it needs to be replaced with try_module_get.  I'll send out an 
> > email to the maintainers of these drivers to see what they think.
> 
> No, I am not that try_module_get() [alone] is quite what is needed, as
> strictly speaking driver lifetime does not need to be the same as module
> lifetime. But maybe I am just splitting hair as all drivers are
> statically initialized and are tied to their modules...

In theory you're right; what matters is when the driver is registered
and unregistered.  (And in fact, although the driver structs are indeed
statically initialized, there also is a struct driver_private part
which doesn't get allocated or initialized until the driver is
registered.)

However, I don't know of any drivers that are unregistered before their
module is unloaded.  We could add an API to the driver core for this
(i.e., to block a driver from being unregistered), but there doesn't
seem to be any real point.

Alan Stern

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