All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime
@ 2026-09-02 12:06 Thomas Weißschuh
  2026-09-02 13:13 ` Nam Cao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-09-02 12:06 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino,
	Anna-Maria Behnsen, Nam Cao
  Cc: linux-kernel, Thomas Weißschuh

When these fields got moved from 'struct vdso_time_data' to the new
'struct vdso_clock', this access was forgotten.

'vd' is not an array, but a pointer to a single structure. The code
works by accident in its current form as CS_HRES_COARSE is 0.

Replace the incorrect array access with a regular pointer dereference.

Fixes: 886653e36639 ("vdso: Rework struct vdso_time_data and introduce struct vdso_clock")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 lib/vdso/gettimeofday.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index f7a591aba59f..6e9b03051bee 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -374,8 +374,8 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *vd,
 		if (vdso_is_timens_clock(vc))
 			vd = vdso_timens_data(vd);
 
-		tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest;
-		tz->tz_dsttime = vd[CS_HRES_COARSE].tz_dsttime;
+		tz->tz_minuteswest = vd->tz_minuteswest;
+		tz->tz_dsttime = vd->tz_dsttime;
 	}
 
 	return 0;

---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260902-vdso-tz-b999f43c24bb

Best regards,
--  
Thomas Weißschuh <thomas.weissschuh@linutronix.de>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime
  2026-09-02 12:06 [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime Thomas Weißschuh
@ 2026-09-02 13:13 ` Nam Cao
  2026-09-02 13:56 ` Vincenzo Frascino
  2026-10-25 22:37 ` [tip: timers/urgent] vdso/gettimeofday: Correct the " tip-bot2 for Thomas Weißschuh
  2 siblings, 0 replies; 4+ messages in thread
From: Nam Cao @ 2026-09-02 13:13 UTC (permalink / raw)
  To: Thomas Weißschuh, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Anna-Maria Behnsen
  Cc: linux-kernel, Thomas Weißschuh

Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
> When these fields got moved from 'struct vdso_time_data' to the new
> 'struct vdso_clock', this access was forgotten.
>
> 'vd' is not an array, but a pointer to a single structure. The code
> works by accident in its current form as CS_HRES_COARSE is 0.
>
> Replace the incorrect array access with a regular pointer dereference.
>
> Fixes: 886653e36639 ("vdso: Rework struct vdso_time_data and introduce struct vdso_clock")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Nam Cao <namcao@linutronix.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime
  2026-09-02 12:06 [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime Thomas Weißschuh
  2026-09-02 13:13 ` Nam Cao
@ 2026-09-02 13:56 ` Vincenzo Frascino
  2026-10-25 22:37 ` [tip: timers/urgent] vdso/gettimeofday: Correct the " tip-bot2 for Thomas Weißschuh
  2 siblings, 0 replies; 4+ messages in thread
From: Vincenzo Frascino @ 2026-09-02 13:56 UTC (permalink / raw)
  To: Thomas Weißschuh, Andy Lutomirski, Thomas Gleixner,
	Anna-Maria Behnsen, Nam Cao
  Cc: linux-kernel



On 02/09/2026 13:06, Thomas Weißschuh wrote:
> When these fields got moved from 'struct vdso_time_data' to the new
> 'struct vdso_clock', this access was forgotten.
> 
> 'vd' is not an array, but a pointer to a single structure. The code
> works by accident in its current form as CS_HRES_COARSE is 0.
> 
> Replace the incorrect array access with a regular pointer dereference.
> 
> Fixes: 886653e36639 ("vdso: Rework struct vdso_time_data and introduce struct vdso_clock")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  lib/vdso/gettimeofday.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index f7a591aba59f..6e9b03051bee 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -374,8 +374,8 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *vd,
>  		if (vdso_is_timens_clock(vc))
>  			vd = vdso_timens_data(vd);
>  
> -		tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest;
> -		tz->tz_dsttime = vd[CS_HRES_COARSE].tz_dsttime;
> +		tz->tz_minuteswest = vd->tz_minuteswest;
> +		tz->tz_dsttime = vd->tz_dsttime;
>  	}
>  
>  	return 0;
> 
> ---
> base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
> change-id: 20260902-vdso-tz-b999f43c24bb
> 
> Best regards,
> --  
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> 

-- 
Regards,
Vincenzo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: timers/urgent] vdso/gettimeofday: Correct the read of tz_minuteswest and tz_dsttime
  2026-09-02 12:06 [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime Thomas Weißschuh
  2026-09-02 13:13 ` Nam Cao
  2026-09-02 13:56 ` Vincenzo Frascino
@ 2026-10-25 22:37 ` tip-bot2 for Thomas Weißschuh
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-10-25 22:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: thomas.weissschuh, Thomas Gleixner, Nam Cao, Vincenzo Frascino,
	x86, linux-kernel

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     cbd0f65b48f52d308c457b0fd5201324abadb501
Gitweb:        https://git.kernel.org/tip/cbd0f65b48f52d308c457b0fd5201324abadb501
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Wed, 02 Sep 2026 14:06:15 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 25 Oct 2026 23:30:54 +01:00

vdso/gettimeofday: Correct the read of tz_minuteswest and tz_dsttime

When these fields got moved from 'struct vdso_time_data' to the new
'struct vdso_clock', this access was forgotten.

'vd' is not an array, but a pointer to a single structure. The code
works by accident in its current form as CS_HRES_COARSE is 0.

Replace the incorrect array access with a regular pointer dereference.

Fixes: 886653e36639 ("vdso: Rework struct vdso_time_data and introduce struct vdso_clock")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://patch.msgid.link/20260902-vdso-tz-v1-1-4d37a6b85ff9@linutronix.de
---
 lib/vdso/gettimeofday.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index f7a591a..6e9b030 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -374,8 +374,8 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *vd,
 		if (vdso_is_timens_clock(vc))
 			vd = vdso_timens_data(vd);
 
-		tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest;
-		tz->tz_dsttime = vd[CS_HRES_COARSE].tz_dsttime;
+		tz->tz_minuteswest = vd->tz_minuteswest;
+		tz->tz_dsttime = vd->tz_dsttime;
 	}
 
 	return 0;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-25 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 12:06 [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime Thomas Weißschuh
2026-09-02 13:13 ` Nam Cao
2026-09-02 13:56 ` Vincenzo Frascino
2026-10-25 22:37 ` [tip: timers/urgent] vdso/gettimeofday: Correct the " tip-bot2 for Thomas Weißschuh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.