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: <3be0e285a52bc022a0280150c7e694297e8f6bbb.1434079263.git.baolin.wang@linaro.org>
Date:	Fri, 12 Jun 2015 15:53:58 +0800
From:	Baolin Wang <baolin.wang@...aro.org>
To:	tglx@...utronix.de
Cc:	arnd@...db.de, john.stultz@...aro.org, pang.xunlei@...aro.org,
	mingo@...nel.org, peterz@...radead.org,
	linux-kernel@...r.kernel.org, baolin.wang@...aro.org,
	y2038@...ts.linaro.org
Subject: [PATCH v5 16/24] timekeeping: Change the implementation of timekeeping_clocktai()

The timekeeping_clocktai() function is not year 2038 safe on 32bit
systems, change its implementation with using struct timespec64.

Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
 include/linux/timekeeping.h |    4 ++--
 kernel/time/posix-timers.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 2dcc86b..07581c0 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -256,9 +256,9 @@ static inline void get_monotonic_boottime64(struct timespec64 *ts)
 	*ts = ktime_to_timespec64(ktime_get_boottime());
 }
 
-static inline void timekeeping_clocktai(struct timespec *ts)
+static inline void timekeeping_clocktai(struct timespec64 *ts)
 {
-	*ts = ktime_to_timespec(ktime_get_clocktai());
+	*ts = ktime_to_timespec64(ktime_get_clocktai());
 }
 
 /*
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 0b0663a..029a2b6 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -296,7 +296,7 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)
 	return 0;
 }
 
-static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
+static int posix_get_tai(clockid_t which_clock, struct timespec64 *tp)
 {
 	timekeeping_clocktai(tp);
 	return 0;
@@ -350,7 +350,7 @@ static __init int init_posix_timers(void)
 	};
 	struct k_clock clock_tai = {
 		.clock_getres	= posix_get_hrtimer_res,
-		.clock_get	= posix_get_tai,
+		.clock_get64	= posix_get_tai,
 		.nsleep		= common_nsleep,
 		.nsleep_restart	= hrtimer_nanosleep_restart,
 		.timer_create	= common_timer_create,
-- 
1.7.9.5

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