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: <alpine.DEB.2.10.1406120216480.5170@nanos>
Date:	Thu, 12 Jun 2014 02:22:33 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	John Stultz <john.stultz@...aro.org>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Kentaro Takeda <takedakn@...data.co.jp>,
	linux-security-module@...r.kernel.org
Subject: Re: [patch 13/13] tomoyo: Use sensible time interface

On Wed, 11 Jun 2014, John Stultz wrote:

> On Wed, Jun 11, 2014 at 4:59 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> > There is no point in calling gettimeofday if only the seconds part of
> > the timespec is used. Use get_seconds() instead. It's not only the
> > proper interface it's also faster.
> 
> My only caution here is you only get tick-granular time here. So if
> the second rolled over after the last tick, you'd get the previous
> second when you call get_seconds(). This can cause some surprising
> effects if the get_seconds() return value is mixed with clocksource
> granular gettimeofday() calls.

If the whole thing only cares about the seconds value, then where is
the problem?

Even if you call gettimeofday() then you still can observe this

gettimeofday(ts)
	ts.tv_sec = 99
	ts.tv_nsec = 999999999

So if you readout the related value ONE nanosecond later, then this
value will have
	ts.tv_sec = 100
	ts.tv_nsec = 0

So what's the point? The tomoyo code chose to take seconds granular
time stamps for whatever reasons. So it should be able to deal with
that, right?

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