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]
Date:   Mon, 27 Apr 2020 00:58:09 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     Bart Van Assche <bvanassche@....org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>
CC:     "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "len.brown@...el.com" <len.brown@...el.com>,
        "pavel@....cz" <pavel@....cz>,
        Michael Kelley <mikelley@...rosoft.com>,
        Long Li <longli@...rosoft.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "ming.lei@...hat.com" <ming.lei@...hat.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        KY Srinivasan <kys@...rosoft.com>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH] PM: hibernate: Freeze kernel threads in software_resume()

> From: Bart Van Assche <bvanassche@....org>
> Sent: Sunday, April 26, 2020 11:34 AM
> To: Rafael J. Wysocki <rjw@...ysocki.net>; Dexuan Cui <decui@...rosoft.com>
> >> --- a/kernel/power/hibernate.c
> >> +++ b/kernel/power/hibernate.c
> >> @@ -898,6 +898,13 @@ static int software_resume(void)
> >>  	error = freeze_processes();
> >>  	if (error)
> >>  		goto Close_Finish;
> >> +
> >> +	error = freeze_kernel_threads();
> >> +	if (error) {
> >> +		thaw_processes();
> >> +		goto Close_Finish;
> >> +	}
> >> +
> >>  	error = load_image_and_restore();
> >>  	thaw_processes();
> >>   Finish:
> >
> > Applied as a fix for 5.7-rc4, thanks!
> 
> Hi Rafael,
> 
> What is not clear to me is how kernel threads are thawed after
> load_image_and_restore() has finished? Should a comment perhaps be added
> above the freeze_kernel_threads() call that explains how
> thaw_kernel_threads() is invoked after load_image_and_restore() has
> finished?
> 
> Bart.

Hi Bart, Rafael, I would suggest the below comment:

If load_image_and_restore() succeeds, it won't return, and the
execution will be restored from the 'old' kernel's hibernate() -> 
hibernation_snapshot() -> create_image() -> swsusp_arch_suspend(),
and later hibernate() -> thaw_processes() will thaw every frozen
kernel process and userspace process of the 'old' kernel.

Thanks,
-- Dexuan

Powered by blists - more mailing lists