linux-yocto/kernel/time
Markus Blöchl 67c632b4a7 timekeeping: Zero initialize system_counterval when querying time from phc drivers
Most drivers only populate the fields cycles and cs_id of system_counterval
in their get_time_fn() callback for get_device_system_crosststamp(), unless
they explicitly provide nanosecond values.

When the use_nsecs field was added to struct system_counterval, most
drivers did not care.  Clock sources other than CSID_GENERIC could then get
converted in convert_base_to_cs() based on an uninitialized use_nsecs field,
which usually results in -EINVAL during the following range check.

Pass in a fully zero initialized system_counterval_t to cure that.

Fixes: 6b2e299775 ("timekeeping: Provide infrastructure for converting to/from a base clock")
Signed-off-by: Markus Blöchl <markus@blochl.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250720-timekeeping_uninit_crossts-v2-1-f513c885b7c2@blochl.de
2025-07-22 14:25:21 +02:00
..
alarmtimer.c alarmtimer: Switch spin_{lock,unlock}_irqsave() to guards 2025-04-30 09:06:23 +02:00
clockevents.c clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TICK_DYING 2024-10-31 10:41:42 +01:00
clocksource-wdtest.c clocksource/wdtest: Print time values for short udelay(1) 2025-01-15 19:49:13 +01:00
clocksource.c clocksource: Fix the CPUs' choice in the watchdog per CPU verification 2025-05-13 15:38:55 +02:00
hrtimer.c hrtimer: Add missing ACCESS_PRIVATE() for hrtimer::function 2025-04-09 21:00:42 +02:00
itimer.c signal: Confine POSIX_TIMERS properly 2024-10-29 11:43:18 +01:00
jiffies.c time/jiffies: Change register_refined_jiffies() to void __init 2025-04-30 09:06:23 +02:00
Kconfig timekeeping: Always check for negative motion 2024-11-02 10:14:31 +01:00
Makefile tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
namespace.c vdso: Rework struct vdso_time_data and introduce struct vdso_clock 2025-03-08 14:37:41 +01:00
ntp_internal.h ntp: Make sure RTC is synchronized when time goes backwards 2024-09-10 13:50:40 +02:00
ntp.c time: Switch to hrtimer_setup() 2025-02-18 10:32:33 +01:00
posix-clock.c Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
posix-cpu-timers.c posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() 2025-06-13 10:55:49 -07:00
posix-stubs.c
posix-timers.c posix-timers: Initialize cache early and move pointer into __timer_data 2025-04-09 21:21:36 +02:00
posix-timers.h posix-timers: Cleanup SIG_IGN workaround leftovers 2024-11-07 02:14:45 +01:00
sched_clock.c time: Switch to hrtimer_setup() 2025-02-18 10:32:33 +01:00
sleep_timeout.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
test_udelay.c
tick-broadcast-hrtimer.c time: Switch to hrtimer_setup() 2025-02-18 10:32:33 +01:00
tick-broadcast.c tick/broadcast: Add kernel-doc for function parameters 2025-01-15 19:49:14 +01:00
tick-common.c timekeeping: Add a lockdep override in tick_freeze() 2025-04-09 22:30:39 +02:00
tick-internal.h clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TICK_DYING 2024-10-31 10:41:42 +01:00
tick-legacy.c
tick-oneshot.c
tick-sched.c time: Switch to hrtimer_setup() 2025-02-18 10:32:33 +01:00
tick-sched.h
time_test.c
time.c time: Fix references to _msecs_to_jiffies() handling of values 2024-10-25 19:50:10 +02:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c timekeeping: Add percpu counter for tracking floor swap events 2024-10-10 10:20:46 +02:00
timekeeping_internal.h clocksource: Make negative motion detection more robust 2024-12-05 16:03:24 +01:00
timekeeping.c timekeeping: Zero initialize system_counterval when querying time from phc drivers 2025-07-22 14:25:21 +02:00
timekeeping.h
timer_list.c hrtimers: Make callback function pointer private 2025-04-05 10:30:17 +02:00
timer_migration.c timers/migration: Fix off-by-one root mis-connection 2025-02-07 09:02:16 +01:00
timer_migration.h timer/migration: Fix kernel-doc warnings for union tmigr_state 2025-01-15 19:49:14 +01:00
timer.c Updates for the time/timer core code: 2025-05-27 09:04:15 -07:00
vsyscall.c timekeeping: Prevent coarse clocks going backwards 2025-04-28 11:17:29 +02:00