]> asedeno.scripts.mit.edu Git - linux.git/commit
rtc: hctosys: Ensure system time doesn't overflow time_t
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 8 Mar 2018 22:27:31 +0000 (23:27 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 27 Mar 2018 08:44:43 +0000 (10:44 +0200)
commitb3a5ac42ab18b7d1a8f2f072ca0ee76a3b754a43
treed3f468b6ad7a41997b09fffe67172b6bd9c05b64
parentf6b1a3a4a72e27234a02d9095080fc811848598c
rtc: hctosys: Ensure system time doesn't overflow time_t

On 32bit platforms, time_t is still a signed 32bit long. If it is
overflowed, userspace and the kernel cant agree on the current system time.
This causes multiple issues, in particular with systemd:
https://github.com/systemd/systemd/issues/1143

A good workaround is to simply avoid using hctosys which is something I
greatly encourage as the time is better set by userspace.

However, many distribution enable it and use systemd which is rendering the
system unusable in case the RTC holds a date after 2038 (and more so after
2106). Many drivers have workaround for this case and they should be
eliminated so there is only one place left to fix when userspace is able to
cope with dates after the 31bit overflow.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/hctosys.c