timekeeping: Reject cross timestamps for invalid AUX clocks
Subsystems (2)
PATCH 1/1 timekeeping: Reject cross timestamps for invalid AUX clocks
get_device_system_crosststamp() accepts AUX clock IDs even when the corresponding timekeeper is disabled. A never-enabled AUX timekeeper has no initialized clocksource, and a previously enabled one can retain stale timekeeping data.
Return -ENODEV before calling the device timestamp callback when the selected timekeeper is invalid.
--- kernel/time/timekeeping.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/time/timekeeping.c +3 -0
@@ -1600,6 +1600,9 @@ int get_device_system_crosststamp(int (*get_time_fn) do { seq = read_seqcount_begin(&tkd->seq); + if (!tk->clock_valid) + return -ENODEV; + /* * Try to synchronously capture device time and a system * counter value calling back into the device driver
base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
Signature · 1 line
2.53.0
The following commit has been merged into the timers/urgent branch of tip:
The following commit has been merged into the timers/urgent branch of tip:
Commit-ID: 67f1969e29b692ab3cfcc97ba175b9109212de00 Gitweb: https://git.kernel.org/tip/67f1969e29b692ab3cfcc97ba175b9109212de00 Author: Avi Weiss <[email protected]> AuthorDate: Sat, 31 Oct 2026 14:22:17 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Mon, 09 Nov 2026 20:15:58 +01:00
timekeeping: Reject cross timestamps for invalid AUX clocks
get_device_system_crosststamp() accepts AUX clock IDs even when the corresponding timekeeper is disabled. A never-enabled AUX timekeeper has no initialized clocksource, and a previously enabled one can retain stale timekeeping data.
Return -ENODEV before calling the device timestamp callback when the selected timekeeper is invalid.
--- kernel/time/timekeeping.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/time/timekeeping.c +3 -0
@@ -1600,6 +1600,9 @@ int get_device_system_crosststamp(int (*get_time_fn) do { seq = read_seqcount_begin(&tkd->seq); + if (!tk->clock_valid) + return -ENODEV; + /* * Try to synchronously capture device time and a system * counter value calling back into the device driver