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: <20111122114549.GC32023@elf.ucw.cz>
Date:	Tue, 22 Nov 2011 12:45:49 +0100
From:	Pavel Machek <pavel@....cz>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	len.brown@...el.com, tj@...nel.org, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM / Hibernation: Fix *massive* memory leak at early
 exits in hibernation

On Mon 2011-11-21 23:25:39, Rafael J. Wysocki wrote:
> On Monday, November 21, 2011, Srivatsa S. Bhat wrote:
> > At some of the early exit points during hibernation (exiting either due
> > to failure or after a successful hibernation test, the memory pre-allocated
> > for hibernation is not freed up. And this is *very* serious, because, during
> > pre-allocation, it could have allocated upto a few *gigabytes* of memory!
> > And hence, if a hibernation fails or even if we run some hibernation tests
> > using the 'pm_test' framework, the system is rendered unstable due to memory
> > becoming signifantly lower. Fix this bug.
> 
> While the observation is valid, I'd prefer to do something like the patch
> below.

The code slowly becomes goto maze :-(.

> @@ -357,12 +357,14 @@ int hibernation_snapshot(int platform_mo
>  		 * successful freezer test.
>  		 */
>  		freezer_test_done = true;
> -		goto Close;
> +		goto Cleanup;
>  	}
>  
>  	error = dpm_prepare(PMSG_FREEZE);
> -	if (error)
> -		goto Complete_devices;
> +	if (error) {
> +		dpm_complete(msg);
> +		goto Cleanup;
> +	}

Perhaps dpm_prepare should be changed to clean after itself in the
error case? That is the normal convention AFAICT....

									Pavel
-- 
(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