diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index ec1791fae96575ffe49c9aa1a2f42cbc6b21df2a..cad61b3f6beaa2983b6dda33a2b1b23a0c444a5b 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1332,6 +1332,12 @@ static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk, * * XXX - TODO: Doc ntp_error calculation. */ + if (tk->tkr.mult + mult_adj < mult_adj) { + /* NTP adjustment caused clocksource mult overflow */ + WARN_ON_ONCE(1); + return; + } + tk->tkr.mult += mult_adj; tk->xtime_interval += interval; tk->tkr.xtime_nsec -= offset;