[GIT pull] timers/urgent for v6.16

Thomas Gleixner posted 1 patch 2 months, 1 week ago
kernel/time/timekeeping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[GIT pull] timers/urgent for v6.16
Posted by Thomas Gleixner 2 months, 1 week ago
Linus,

please pull the latest timers/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2025-07-27

up to:  67c632b4a7fb: timekeeping: Zero initialize system_counterval when querying time from phc drivers


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.

Thanks,

	tglx

------------------>
Markus Blöchl (1):
      timekeeping: Zero initialize system_counterval when querying time from phc drivers


 kernel/time/timekeeping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index a009c91f7b05..83c65f3afcca 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1256,7 +1256,7 @@ int get_device_system_crosststamp(int (*get_time_fn)
 				  struct system_time_snapshot *history_begin,
 				  struct system_device_crosststamp *xtstamp)
 {
-	struct system_counterval_t system_counterval;
+	struct system_counterval_t system_counterval = {};
 	struct timekeeper *tk = &tk_core.timekeeper;
 	u64 cycles, now, interval_start;
 	unsigned int clock_was_set_seq = 0;
Re: [GIT pull] timers/urgent for v6.16
Posted by pr-tracker-bot@kernel.org 2 months, 1 week ago
The pull request you sent on Sun, 27 Jul 2025 13:58:14 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2025-07-27

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/b711733e89a3f84c8e1e56e2328f9a0fa5facc7c

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html