summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-08-03 17:07:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-14 13:52:58 +0200
commit026e1f6903b41be32fab57a3cc66747b22670434 (patch)
treebf2569ec470ce0b8c50b79d656b0f4c486ccf59b
parente05c08391a2e9a1ba105acb65c994dece28d94d7 (diff)
downloadlinux-026e1f6903b41be32fab57a3cc66747b22670434.tar.gz
linux-026e1f6903b41be32fab57a3cc66747b22670434.tar.bz2
linux-026e1f6903b41be32fab57a3cc66747b22670434.zip
timekeeping: Fix bogus clock_was_set() invocation in do_adjtimex()
commit 5916be8a53de6401871bdd953f6c60237b47d6d3 upstream. The addition of the bases argument to clock_was_set() fixed up all call sites correctly except for do_adjtimex(). This uses CLOCK_REALTIME instead of CLOCK_SET_WALL as argument. CLOCK_REALTIME is 0. As a result the effect of that clock_was_set() notification is incomplete and might result in timers expiring late because the hrtimer code does not re-evaluate the affected clock bases. Use CLOCK_SET_WALL instead of CLOCK_REALTIME to tell the hrtimers code which clock bases need to be re-evaluated. Fixes: 17a1b8826b45 ("hrtimer: Add bases argument to clock_was_set()") Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/877ccx7igo.ffs@tglx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/time/timekeeping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b158cbef4d8d..8ac43afc11f9 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2476,7 +2476,7 @@ int do_adjtimex(struct __kernel_timex *txc)
clock_set |= timekeeping_advance(TK_ADV_FREQ);
if (clock_set)
- clock_was_set(CLOCK_REALTIME);
+ clock_was_set(CLOCK_SET_WALL);
ntp_notify_cmos_timer();