Skip to content

Commit e1fe1b1

Browse files
committed
Merge tag 'timers_urgent_for_v5.16_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Borislav Petkov: - Make sure the CLOCK_REALTIME to CLOCK_MONOTONIC offset is never positive * tag 'timers_urgent_for_v5.16_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Really make sure wall_to_monotonic isn't positive
2 parents 909e1d1 + 4e8c11b commit e1fe1b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/time/timekeeping.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,8 +1306,7 @@ int do_settimeofday64(const struct timespec64 *ts)
13061306
timekeeping_forward_now(tk);
13071307

13081308
xt = tk_xtime(tk);
1309-
ts_delta.tv_sec = ts->tv_sec - xt.tv_sec;
1310-
ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec;
1309+
ts_delta = timespec64_sub(*ts, xt);
13111310

13121311
if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) {
13131312
ret = -EINVAL;

0 commit comments

Comments
 (0)