Messages in this thread | | | Date | Thu, 23 Oct 2014 21:22:39 -0700 | Subject | Re: [PATCH 1/2] time: Fix NTP adjustment mult overflow. | From | John Stultz <> |
| |
On Wed, Oct 22, 2014 at 5:37 AM, Xunlei Pang <pang.xunlei@linaro.org> wrote: > The mult memember of struct clocksource should always be a large u32 number > when calculated through > __clocksource_updatefreq_scale(). The value of (cs->mult+cs->maxadj) may > have a chance to reach very > near 0xFFFFFFFF, so it may overflow when doing NTP positive adjustment, see > the following detail: > When NTP slewes the clock, kernel goes through > update_wall_time()->...->timekeeping_apply_adjustment(): > tk->tkr.mult += mult_adj; > Unfortunately, tk->tkr.mult may overflow after this operation. > > > This patch avoids mult overflow by judging the overflow case before adding > mult_adj to mult, also adds the > WARNING message when capturing such case. > > Signed-off-by: pang.xunlei <pang.xunlei@linaro.org>
I reworded this a bit further, but its in my queue for 3.19.
thanks -john
| |