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: <CACVXFVObp-DYjBGBiVjDdmD6P-bsh-xO79fxSxGqDWbRyk0Anw@mail.gmail.com>
Date:	Tue, 5 Jun 2012 17:38:39 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Alan Stern <stern@...land.harvard.edu>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH] driver core: fix shutdown races with probe/remove

Hi,

On Tue, Jun 5, 2012 at 5:18 PM, Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
> On Tue, Jun 05, 2012 at 04:59:07PM +0800, Ming Lei wrote:
>> Firstly, .shutdown callback may touch a uninitialized hardware
>> if dev->driver is set and .probe is not completed.
>
> When would that ever happen?

It may happen when someone plugs a device, then run 'shutdown' immediately.

>
>> Secondly, device_shutdown() may dereference a null pointer to cause
>> oops when dev->driver is cleared after it is checked in device_shutdown().
>
> Again, when would that happen?  A new device/driver being added to the
> system as it is being shutdown?

It is usually that someone presses 'power off' button and unplugs
its usb devices or pci/e devices, maybe together with a new plug.

In such case, the oops may be triggered.

>
> Has anyone ever hit that before?

Looks someone has reported it, I also can trigger it
with some delay added in device_shutdown.

>
> Is this really needed?

In case that it is triggered, oops will prevent system from being
shutdown, and it should be a big problem.

IMO, we can avoid it without much change and side effect, so
looks worthy the change.

Thanks,
--
Ming Lei
--
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