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: <b9d06e6378a7c3b0e0b2561ab2a971c8fa1ff3e9.camel@linux.intel.com>
Date:   Thu, 16 Dec 2021 20:44:13 +0100
From:   Thomas Hellström 
        <thomas.hellstrom@...ux.intel.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux PM <linux-pm@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH] PM: sleep: Fix error handling in dpm_prepare()

On Thu, 2021-12-16 at 20:30 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> Commit 2aa36604e824 ("PM: sleep: Avoid calling put_device() under
> dpm_list_mtx") forgot to update the while () loop termination
> condition to also break the loop if error is nonzero, which
> causes the loop to become infinite if device_prepare() returns
> an error for one device.
> 
> Add the missing !error check.
> 
> Fixes: 2aa36604e824 ("PM: sleep: Avoid calling put_device() under
> dpm_list_mtx")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Thomas Hellström <thomas.hellstrom@...ux.intel.com>

Was this meant to be a Reported-by:?
Also Cc stable? IIRC 2aa36604e824 was.

In any case,
Reviewed-by: Thomas Hellström <thomas.hellstrom@...ux.intel.com>

Thanks,
Thomas


> ---
>  drivers/base/power/main.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-pm/drivers/base/power/main.c
> ===================================================================
> --- linux-pm.orig/drivers/base/power/main.c
> +++ linux-pm/drivers/base/power/main.c
> @@ -1902,7 +1902,7 @@ int dpm_prepare(pm_message_t state)
>         device_block_probing();
>  
>         mutex_lock(&dpm_list_mtx);
> -       while (!list_empty(&dpm_list)) {
> +       while (!list_empty(&dpm_list) && !error) {
>                 struct device *dev = to_device(dpm_list.next);
>  
>                 get_device(dev);
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ