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] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1301151044560.6514-100000@netrider.rowland.org>
Date:	Tue, 15 Jan 2013 10:50:18 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Liu, Chuansheng" <chuansheng.liu@...el.com>
cc:	"Rafael J. Wysocki" <rjw@...k.pl>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] PM / Runtime: Fix the twice judgement in rpm_suspend/resume()

On Tue, 15 Jan 2013, Liu, Chuansheng wrote:

> > Indeed, this patch introduces a race.  If runtime_status changes from
> > RPM_SUSPENDING and power.wait_queue is signalled in between the test at
> > the end of the loop and the prepare_to_wait() call, the loop will never
> > end.
> Checking the race case, it should not happen?
> Updating runtime_status and wake_up wait_queue are protected by power.lock.
> spin_lock(&power.lock)
> ...
> __update_runtime_status()
> ...
> wake_up_all(&dev->power.wait_queue)
> ...
> spin_unlock(&power.lock)

You're right, the lock prevents this race from happening.

On the other hand, with your change we would end up calling finish_wait()
without calling prepare_to_wait() first.  And as Rafael mentioned, the
current code fits the pattern that people expect to see.

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