Skip to content

Commit 2f58413

Browse files
arndbKAGA-KOKO
authored andcommitted
ntp/y2038: Remove incorrect time_t truncation
A cast to 'time_t' was accidentally left in place during the conversion of __do_adjtimex() to 64-bit timestamps, so the resulting value is incorrectly truncated. Remove the cast so the 64-bit time gets propagated correctly. Fixes: ead2541 ("timex: use __kernel_timex internally") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 31f4f5b commit 2f58413

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/ntp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts,
771771
/* fill PPS status fields */
772772
pps_fill_timex(txc);
773773

774-
txc->time.tv_sec = (time_t)ts->tv_sec;
774+
txc->time.tv_sec = ts->tv_sec;
775775
txc->time.tv_usec = ts->tv_nsec;
776776
if (!(time_status & STA_NANO))
777777
txc->time.tv_usec = ts->tv_nsec / NSEC_PER_USEC;

0 commit comments

Comments
 (0)