linux-kernelorg-stable/kernel/time
Haofeng Li 39a9ed0fb6 timekeeping: Fix aux clocks sysfs initialization loop bound
The loop in tk_aux_sysfs_init() uses `i <= MAX_AUX_CLOCKS` as the
termination condition, which results in 9 iterations (i=0 to 8) when
MAX_AUX_CLOCKS is defined as 8. However, the kernel is designed to support
only up to 8 auxiliary clocks.

This off-by-one error causes the creation of a 9th sysfs entry that exceeds
the intended auxiliary clock range.

Fix the loop bound to use `i < MAX_AUX_CLOCKS` to ensure exactly 8
auxiliary clock entries are created, matching the design specification.

Fixes: 7b95663a3d ("timekeeping: Provide interface to control auxiliary clocks")
Signed-off-by: Haofeng Li <lihaofeng@kylinos.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://patch.msgid.link/tencent_2376993D9FC06A3616A4F981B3DE1C599607@qq.com
2025-10-20 19:56:12 +02:00
..
Kconfig
Makefile time: Build generic update_vsyscall() only with generic time vDSO 2025-09-04 11:23:50 +02:00
alarmtimer.c time: Fix spelling mistakes in comments 2025-09-21 10:02:02 +02:00
clockevents.c tick: Do not set device to detached state in tick_shutdown() 2025-09-09 13:39:00 +02:00
clocksource-wdtest.c
clocksource.c time: Fix spelling mistakes in comments 2025-09-21 10:02:02 +02:00
hrtimer.c Updates for the time(rs) core subsystem: 2025-09-30 16:09:27 -07:00
itimer.c timers/itimer: Avoid direct access to hrtimer clockbase 2025-09-09 12:27:17 +02:00
jiffies.c
namespace.c namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
ntp.c
ntp_internal.h
posix-clock.c
posix-cpu-timers.c
posix-stubs.c
posix-timers.c time: Fix spelling mistakes in comments 2025-09-21 10:02:02 +02:00
posix-timers.h
sched_clock.c time/sched_clock: Export symbol for sched_clock register function 2025-09-23 10:52:31 +02:00
sleep_timeout.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c
tick-common.c tick: Do not set device to detached state in tick_shutdown() 2025-09-09 13:39:00 +02:00
tick-internal.h tick: Do not set device to detached state in tick_shutdown() 2025-09-09 13:39:00 +02:00
tick-legacy.c
tick-oneshot.c
tick-sched.c
tick-sched.h
time.c time: export timespec64_add_safe() symbol 2025-09-03 16:51:08 -07:00
time_test.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c timekeeping: Fix aux clocks sysfs initialization loop bound 2025-10-20 19:56:12 +02:00
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h
timer.c
timer_list.c hrtimer: Remove hrtimer_clock_base:: Get_time 2025-09-09 12:27:18 +02:00
timer_migration.c
timer_migration.h
vsyscall.c vdso/vsyscall: Avoid slow division loop in auxiliary clock update 2025-09-03 11:55:11 +02:00