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]
Date:	Fri, 2 Dec 2011 20:30:37 +0100
From:	Pavel Machek <pavel@....cz>
To:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc:	Tejun Heo <tj@...nel.org>, rjw@...k.pl, len.brown@...el.com,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM / Hibernate: Thaw processes in
	SNAPSHOT_CREATE_IMAGE ioctl error/test paths

> On 12/01/2011 09:17 PM, Tejun Heo wrote:
> 
> > On Thu, Dec 01, 2011 at 06:45:37PM +0530, Srivatsa S. Bhat wrote:
> >> Commit 2aede851ddf08666f68ffc17be446420e9d2a056 (PM / Hibernate: Freeze
> >> kernel threads after preallocating memory) moved the freezing of kernel
> >> threads to hibernation_snapshot() function.
> >>
> >> So now, if the call to hibernation_snapshot() fails or returns early due
> >> to a successful hibernation test, the caller has to thaw processes to
> >> ensure that the system gets back to its original state.
> >>
> >> But in SNAPSHOT_CREATE_IMAGE hibernation ioctl, the caller does not thaw
> >> processes. Fix this issue. But note that if hibernation_snapshot() returned
> >> due to a successful freezer test, we still send the value of 'in_suspend'
> >> (which is now 0) to userspace, because we are not in an error path per-se,
> >> and moreover, the value of in_suspend correctly depicts the situation here.
> >>
> >> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
> > 
> > Is this still applicable on top of pm-freezer branch?
> > 
> 
> 
> Well, yes, but not in this form. Thanks for bringing that up!
> 
> If the call to hibernation_snapshot() returns an error, we need not do
> anything since your freezer changes handle that case and call thaw_processes()
> automatically.
> But in case of return due to a successful freezer test, we would need to
> explicitly thaw processes since the freezer successfully froze them in the
> previous step.
> 
> So the following patch would do that, for the pm-freezer branch:
> 
> ---
> From: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
> Subject: [PATCH] PM / Hibernate: Thaw processes in SNAPSHOT_CREATE_IMAGE ioctl test path
> 
> Commit 2aede851ddf08666f68ffc17be446420e9d2a056 (PM / Hibernate: Freeze
> kernel threads after preallocating memory) moved the freezing of kernel
> threads to hibernation_snapshot() function.
> 
> So now, if the call to hibernation_snapshot() returns early due to a
> successful hibernation test, the caller has to thaw processes to ensure
> that the system gets back to its original state.
> 
> But in SNAPSHOT_CREATE_IMAGE hibernation ioctl, the caller does not thaw
> processes in case hibernation_snapshot() returned due to a successful
> freezer test. Fix this issue. But note we still send the value of 'in_suspend'
> (which is now 0) to userspace, because we are not in an error path per-se,
> and moreover, the value of in_suspend correctly depicts the situation here.
> 
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>

Ack.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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