]> git.baikalelectronics.ru Git - kernel.git/commit
ntp: Fix RTC synchronization on 32-bit platforms
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Jan 2021 10:39:56 +0000 (11:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 Jan 2021 20:13:01 +0000 (21:13 +0100)
commitae3c3bba3db9110b767abd1e8df3c664e0898bfa
tree120f822ecb73dcec0cbea6de1cf0520cce478416
parent057880c60404dbac1333dbc4668846595bd40cd0
ntp: Fix RTC synchronization on 32-bit platforms

Due to an integer overflow, RTC synchronization now happens every 2s
instead of the intended 11 minutes.  Fix this by forcing 64-bit
arithmetic for the sync period calculation.

Annotate the other place which multiplies seconds for consistency as well.

Fixes: 850e72662da5b301 ("ntp: Make the RTC synchronization more reliable")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210111103956.290378-1-geert+renesas@glider.be
kernel/time/ntp.c