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: <20080913112051.GA6827@ucw.cz>
Date:	Sat, 13 Sep 2008 13:20:51 +0200
From:	Pavel Machek <pavel@...e.cz>
To:	Frans Pop <elendil@...net.nl>, "Rafael J. Wysocki" <rjw@...k.pl>,
	Andrew Morton <akpm@...l.org>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch] Document use of RTC in pm_trace

On Wed 2008-09-10 20:07:08, Frans Pop wrote:
> On Wednesday 10 September 2008, Linus Torvalds wrote:
> > On Wed, 10 Sep 2008, Frans Pop wrote:
> > > But I would not expect the RTC to get changed when the resume is
> > > successful. Or does it just get updated with every resume step
> > > without a reset to the pre-trace value on completion?
> >
> > Indeed. We don't know where the bug happens when tracing, so each
> > trace-point just writes its hash value into it. And nothing restores
> > it, since nothing knows that the resume is "done" (a lot of problems
> > happen due to X interactions much later than the 'core' resume thing).
> 
> Right. How about this patch then?
> 
> ---
> From: Frans Pop <elendil@...net.nl>
> 
> As pm_trace uses the system's hardware clock to save its magic
> value, users of that option should be warned that using this debug
> option will result in an incorrect system time after resume.
>     
> Signed-off-by: Frans Pop <elendil@...net.nl>

ACK.

> diff --git a/Documentation/power/s2ram.txt b/Documentation/power/s2ram.txt
> index b05f512..2ebdc60 100644
> --- a/Documentation/power/s2ram.txt
> +++ b/Documentation/power/s2ram.txt
> @@ -54,3 +54,21 @@ used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
>  that "radeonfb" simply cannot resume that device - it tries to set the
>  PLL's, and it just _hangs_. Using the regular VGA console and letting X
>  resume it instead works fine.
> +
> +NOTE
> +====
> +pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
> +Reason for this is that the RTC is the only reliably available piece of
> +hardware during resume operations where a value can be set that will
> +survive a reboot.
> +
> +Consequence is that after a resume (even if it is successful) your system
> +clock will have a value corresponding to the magic mumber instead of the
> +correct date/time! It is therefore advisable to use a program like ntp-date
> +or rdate to reset the correct date/time from an external time source when
> +using this trace option.
> +
> +As the clock keeps ticking it is also essential that the reboot is done
> +quickly after the resume failure. The trace option does not use the seconds
> +or the low order bits of the minutes of the RTC, but a too long delay will
> +corrupt the magic value.
> --
> 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/

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