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>] [day] [month] [year] [list]
Date:	Fri, 17 Sep 2010 15:52:03 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Kyle Moffett <kyle@...fetthome.net>
cc:	Alexander Shishkin <virtuoso@...nd.org>,
	LKML <linux-kernel@...r.kernel.org>,
	John Stultz <johnstul@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Kay Sievers <kay.sievers@...y.org>, Greg KH <gregkh@...e.de>,
	Chris Friesen <chris.friesen@...band.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill@...temov.name>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCHv5 0/7] system time changes notification

On Fri, 17 Sep 2010, Kyle Moffett wrote:
> On Fri, Sep 17, 2010 at 08:57, Thomas Gleixner <tglx@...utronix.de> wrote:
> 
> > On Fri, 17 Sep 2010, Alexander Shishkin wrote:
> > > Consider we want stuff like "wakeup every day at 3pm", the next wakeup
> > > might be earlier than the timer we calculated last time, on system
> > > time changes. We need to re-calculate it. This is necessary for all
> > > repeating events.
> > >
> > > Say we want to wakeup at 3pm, now it's 4pm, so we schedule it in 23
> > > hours. Now the system time changes to 2pm, and we would expect to
> > > wakeup in one hour, but we take 25.
> >
> > And that's why we have posix-timers with the ability to arm absolute
> > timers. They already deal with the clock being set.
> >
> > man timer_settime
> >
> 
> This still doesn't help with the specified use-case.  For example, consider
> the case of configuring my crontab to run a command every day at 2PM.
> 
> Let's assume that I then start the cron daemon at 2:05PM, and it establishes
> an absolute timer at 2PM the following day.
>
> I then realize that the clock is wrong, and correct it to read 1:55PM.
> 
> The problem is... cron's timer is still set to trigger at 2PM *tomorrow*,
> instead of being readjusted at the time the clock is changed to go off at
> 2PM *today*.
> 
> Right now there's really no way to fix that other than polling every so
> often to recheck the system time is what you expect.

Hmm, ok.

So what you really want is a timer which drops back to user space with
an appropriate error code when something fiddled with the clock.

That's reasonably easy to implement as an extension at least for
clock_nanosleep. For the signal based timers it'd be probably quite
nasty, but doable.

Thanks,

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