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:   Wed, 28 Feb 2018 14:21:24 +0800
From:   Baolin Wang <baolin.wang@...aro.org>
To:     kstewart@...uxfoundation.org, gregkh@...uxfoundation.org,
        tglx@...utronix.de, pombredanne@...b.com, arnd@...db.de
Cc:     linux-kernel@...r.kernel.org, broonie@...nel.org,
        baolin.wang@...aro.org
Subject: [PATCH] m32r: Use read_persistent_clock64() instead of read_persistent_clock()

Since struct timespec is not y2038 safe on 32bit machines, this patch
converts read_persistent_clock() to read_persistent_clock64() using
struct timespec64, as well as converting mktime() to mktime64().

Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
 arch/m32r/kernel/time.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 521749f..3ef3123 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -138,7 +138,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
 	.name = "MFT2",
 };
 
-void read_persistent_clock(struct timespec *ts)
+void read_persistent_clock64(struct timespec64 *ts)
 {
 	unsigned int epoch, year, mon, day, hour, min, sec;
 
@@ -158,7 +158,7 @@ void read_persistent_clock(struct timespec *ts)
 		epoch = 1952;
 	year += epoch;
 
-	ts->tv_sec = mktime(year, mon, day, hour, min, sec);
+	ts->tv_sec = mktime64(year, mon, day, hour, min, sec);
 	ts->tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
 }
 
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ