mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karl Mehltretter <kmehltretter@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	 linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: class: Make the time32 hctosys limit configurable
Date: Sat, 19 Sep 2026 02:10:51 +0200	[thread overview]
Message-ID: <aq3R5QnCpu_fOq8g@gmail.com> (raw)
In-Reply-To: <59ba6707-c5d5-4fd8-9200-f910e61d9232@app.fastmail.com>

On Wed, Sep 16, 2026 at 08:56:02AM +0100, Arnd Bergmann wrote:
> > existing safeguard automatically and prevent restoring it without
> > re-enabling the legacy ABI.
> 
> I'm not following your logic here, what is the safeguard?

I meant the existing RTC cutoff. In my glibc test, accepting the
2040 RTC date changes time32 clock_gettime() from success to
EOVERFLOW.

> With a fixed C library, COMPAT_32BIT_TIME=n should act as a safeguard
> to ensure that no interfaces can be used that limit time to y2038
> and break unexpectedly in the future. The RTC_HCTOSYS interface

Should we try adding an option to build glibc and other libcs without
time32 interfaces? Looking at musl's source, its time32 clock_gettime()
wrapper also calls the time64 implementation and checks whether the
result fits [1].

> actually make it work. Since we have COMPAT_32BIT_TIME as a global
> option already, it makes a lot of sense to actually use it here
> as well.

Could we use COMPAT_32BIT_TIME for the default, but still allow the
limit to be enabled? I could split the update into two patches:

1. Add RTC_HCTOSYS_TIME32_LIMIT with default y, as posted. This keeps
   the existing RTC date acceptance by default.

2. Change the default, keeping the dependency unchanged:

       depends on RTC_HCTOSYS && !64BIT
       default COMPAT_32BIT_TIME

With RTC_HCTOSYS=y on a 32-bit kernel, the default would allow
post-2038 RTC dates when COMPAT_32BIT_TIME=n. Integrators could still
enable the limit without re-enabling legacy syscalls.

I suggest nominating the first patch for stable. Would default
COMPAT_32BIT_TIME also be suitable for stable?

[1] https://git.musl-libc.org/cgit/musl/tree/compat/time32/clock_gettime32.c

Thanks,
Karl

  reply	other threads:[~2026-09-19  0:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 21:25 Karl Mehltretter
2026-09-15  5:48 ` Arnd Bergmann
2026-09-15 22:37   ` Karl Mehltretter
2026-09-16  6:56     ` Arnd Bergmann
2026-09-19  0:10       ` Karl Mehltretter [this message]
2026-09-19  9:16         ` Arnd Bergmann

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=aq3R5QnCpu_fOq8g@gmail.com \
    --to=kmehltretter@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®