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: <3413769.dlVTNxayVy@aspire.rjw.lan>
Date:   Fri, 20 Oct 2017 03:22:07 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Jeffy Chen <jeffy.chen@...k-chips.com>, gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org, briannorris@...omium.org,
        heiko@...ech.de, dmitry.torokhov@...il.com, dianders@...omium.org,
        tfiga@...omium.org, broonie@...nel.org, seanpaul@...omium.org,
        thierry.reding@...il.com
Subject: Re: [PATCH v3] driver core: Move device_links_purge() after bus_remove_device()

On Friday, October 20, 2017 3:23:16 AM CEST Jeffy Chen wrote:
> The current ordering of code in device_del() triggers a WARN_ON()
> in device_links_purge(), because of an unexpected link status.
> 
> The device_links_unbind_consumers() call in device_release_driver()
> has to take place before device_links_purge() for the status of all
> links to be correct, so move the device_links_purge() call in
> device_del() after the invocation of bus_remove_device() which calls
> device_release_driver().
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

OK, thanks.

Greg, will you take this?

> ---
> 
> Changes in v3:
> Remove wrong signed-off-by.
> 
> Changes in v2:
> Update commit message provided by Rafael.
> 
>  drivers/base/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 12ebd055724c..2e683cdf4a08 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1958,7 +1958,6 @@ void device_del(struct device *dev)
>  		blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
>  					     BUS_NOTIFY_DEL_DEVICE, dev);
>  
> -	device_links_purge(dev);
>  	dpm_sysfs_remove(dev);
>  	if (parent)
>  		klist_del(&dev->p->knode_parent);
> @@ -1986,6 +1985,7 @@ void device_del(struct device *dev)
>  	device_pm_remove(dev);
>  	driver_deferred_probe_del(dev);
>  	device_remove_properties(dev);
> +	device_links_purge(dev);
>  
>  	/* Notify the platform of the removal, in case they
>  	 * need to do anything...
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ