Skip to content

Commit b711733

Browse files
committed
Merge tag 'timers-urgent-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Thomas Gleixner: "A single fix for the PTP systemcounter mechanism: The rework of this mechanism added a 'use_nsec' member to struct system_counterval. get_device_system_crosststamp() instantiates that struct on the stack and hands a pointer to the driver callback. Only the drivers which set use_nsec to true, initialize that field, but all others ignore it. As get_device_system_crosststamp() does not initialize the struct, the use_nsec field contains random stack content in those cases. That causes a miscalulation usually resulting in a failing range check in the best case. Initialize the structure before handing it to the drivers to cure that" * tag 'timers-urgent-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Zero initialize system_counterval when querying time from phc drivers
2 parents ec2df43 + 67c632b commit b711733

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/timekeeping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ int get_device_system_crosststamp(int (*get_time_fn)
12561256
struct system_time_snapshot *history_begin,
12571257
struct system_device_crosststamp *xtstamp)
12581258
{
1259-
struct system_counterval_t system_counterval;
1259+
struct system_counterval_t system_counterval = {};
12601260
struct timekeeper *tk = &tk_core.timekeeper;
12611261
u64 cycles, now, interval_start;
12621262
unsigned int clock_was_set_seq = 0;

0 commit comments

Comments
 (0)