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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150601195909.GO4710@piout.net>
Date:	Mon, 1 Jun 2015 21:59:09 +0200
From:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	pang.xunlei@....com.cn, Alessandro Zummo <a.zummo@...ertech.it>,
	Andrew Christian <andrew.christian@...com>,
	CIH <cih@...entive.com>, John Stultz <john.stultz@...aro.org>,
	linux-kernel@...r.kernel.org, Nicolas Pitre <nico@...xnic.net>,
	Xunlei Pang <pang.xunlei@...aro.org>,
	Richard Purdie <rpurdie@...ys.net>, rtc-linux@...glegroups.com,
	Xunlei Pang <xlpang@....com>
Subject: Re: [5/5] drivers/rtc/sa1100: Replace deprecated rtc_tm_to_time()
 and rtc_time_to_tm()

Hi,

On 01/06/2015 at 21:43:22 +0200, Arnd Bergmann wrote :
> Note that Alexandre has stepped up as a new maintainer for RTC now,
> so whatever he wants is probably the way it should be done.
> 

I'm still quite new in that position and I didn't make my mind in a lot
of different topics ;)

> I think the way that your first approach came out was a bit unfortunate,
> because we didn't have agreement on how it should really be done.
> 
> IMHO the rtc_time64_to_hw32 and rtc_hw32_to_time64 interfaces were a
> good concept, most importantly so we can easily find where the potential
> problems are, but the implementation was a bit too ambitious in trying
> to fix the underlying issue.
> 
> If we want to start this over again, I think a better approach would be
> to introduce trivial functions at first, like
> 
> time64_t rtc_hw32_to_time64(u32 hwtime)
> {
> 	/* 
> 	 * this is safe until about 2106, when unsigned u32 seconds from the
> 	 * 1970 epoch will overflow
> 	 */
> 	return (u64)hwtime;
> }
> EXPORT_SYMBOL_GPL(rtc_hw32_to_time64);
> 
> This way, we can fix all the drivers without introducing any possible
> ambiguity and later decide how that function should in fact handle the
> 2106 overflow. Our grandchildren can take care of that if necessary ;-)
> 

We also have RTCs that can only store the year as an integer between 0
and 99. Some of them will definitively not pass 2099, considering that
the can only handle leap days between 2000 and 2099. Also, we have a few
drivers assuming that year >= 70 is in the 19s so they will stop working
correctly in 2070. I think we also have to consider those while trying
to find a solution.

I feel that we still have a bit of time before having to hurry and find
a proper solution ;)

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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