All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH] system/rtc: Fix a possible year-2038 integer overflow problem
Date: Mon, 18 May 2026 17:10:36 +0100	[thread overview]
Message-ID: <ags5_IDkvxClCdHm@redhat.com> (raw)
In-Reply-To: <20260518160255.1844308-1-thuth@redhat.com>

On Mon, May 18, 2026 at 06:02:55PM +0200, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> rtc_realtime_clock_offset is initialized with:
> 
>   rtc_realtime_clock_offset = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) / 1000;
> 
> And QEMU_CLOCK_REALTIME might be based on gettimeofday() in certain
> cases (see get_clock_realtime() in include/qemu/timer.h). So this
> counter will exceed 32 bits in the year 2038, thus we should not
> store this value in a normal integer variable. Change it to an int64_t
> to fix the problem.
> And while we're at it, also adjust the nearby rtc_host_datetime_offset
> variable to be on the safe side in the related code.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  system/rtc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  reply	other threads:[~2026-05-18 16:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 16:02 [PATCH] system/rtc: Fix a possible year-2038 integer overflow problem Thomas Huth
2026-05-18 16:10 ` Daniel P. Berrangé [this message]
2026-05-18 16:18   ` Daniel P. Berrangé
2026-05-18 16:30     ` Thomas Huth
2026-05-19  8:24     ` Philippe Mathieu-Daudé
2026-05-19  9:18       ` Thomas Huth
2026-05-19  9:26         ` Thomas Huth
2026-05-19  9:56           ` Philippe Mathieu-Daudé
2026-05-19 10:21           ` Peter Maydell
2026-05-19 11:01             ` Thomas Huth
2026-05-19 12:15           ` Alex Bennée
2026-05-19 20:20       ` Richard Henderson
2026-05-18 16:15 ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ags5_IDkvxClCdHm@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.