Linux userland API discussions
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: "Andy Lutomirski" <luto@kernel.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Christophe Leroy" <chleroy@kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
	"John Stultz" <jstultz@google.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Andreas Larsson" <andreas@gaisler.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org,
	linux-api@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH v2 1/9] time: Respect COMPAT_32BIT_TIME for old time type functions
Date: Wed, 01 Jul 2026 15:11:56 +0200	[thread overview]
Message-ID: <a512dc5f-0734-4bd0-838c-61c8820e5f6d@app.fastmail.com> (raw)
In-Reply-To: <20260701102912-ea8f3291-7bba-407b-9a7d-7c367a4c9398@linutronix.de>

On Wed, Jul 1, 2026, at 10:40, Thomas Weißschuh wrote:
> On Tue, Jun 30, 2026 at 03:00:37PM +0200, Arnd Bergmann wrote:
>> On Tue, Jun 30, 2026, at 09:38, Thomas Weißschuh wrote:
>> > The "old" time types use 32-bit seconds which are not y2038-safe.
>> > Respect COMPAT_32BIT_TIME for functions using those types.
>> > time(), stime() and gettimeofday() are disabled completely.
>> 
>> Looks good, yes
>
> Sashiko found an issue [0], which I think is valid. I'll change that for v3.

Ok

>> > settimeofday() is kept as it is required to do the initial timewarping
>> > after boot. However the 'tv' argument will be rejected.
>> 
>> Not sure about this part, did we already discuss this last time?
>
> This is my interpretation of [1].

Indeed, we did.

>> I can see how keeping the timewarping functionality is the easy way
>> out, but completely disabling the settimeofday syscall the same
>> way we do on new architectures seems so much more consistent.
>
> Shouldn't we then do this completely? Irrespective of COMPAT_32BIT_TIME?
> And then remove all of the timewarping and kernel timezone bits.

I don't think we can simply kill the timewarping code since that
likely has users on architectures including on x86-64.

COMPAT_32BIT_TIME=n is somewhat special because this is an
intentional (and optional) ABI break already and requires
updated userspace that avoids the time32 syscalls. Having the
timewarp still in settimeofday() or dropping it entirely is not
that different for userspace.

I was slightly worried about whether returning -EINVAL or -ENOSYS
is the better option here, but I think your choice is the correct
one after seeing that this is what glibc does other invalid
cases, and that in all of codesearch.debian.net, I could not
find a single caller that would care about the difference.

> It would be nice however if this series, and my other ones blocked behind it,
> are not blocked on that larger rework.

Sure.

I think you can go ahead with this version. I would prefer
to not have any settimeofday() for the COMPAT_32BIT_TIME=n
case, but if nobody else has a strong opinion on the matter,
let's do it your way.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

  reply	other threads:[~2026-07-01 13:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  7:38 [PATCH v2 0/9] vDSO: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-06-30  7:38 ` [PATCH v2 1/9] time: Respect COMPAT_32BIT_TIME for old time type functions Thomas Weißschuh
2026-06-30 13:00   ` Arnd Bergmann
2026-07-01  8:40     ` Thomas Weißschuh
2026-07-01 13:11       ` Arnd Bergmann [this message]
2026-06-30  7:38 ` [PATCH v2 2/9] vdso/gettimeofday: Validate system call existence for time() and gettimeofday() Thomas Weißschuh
2026-07-01  7:47   ` Philippe Mathieu-Daudé
2026-06-30  7:38 ` [PATCH v2 3/9] x86/vdso: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-06-30  7:38 ` [PATCH v2 4/9] arm64: vdso32: " Thomas Weißschuh
2026-07-01  7:49   ` Philippe Mathieu-Daudé
2026-06-30  7:38 ` [PATCH v2 5/9] ARM: VDSO: " Thomas Weißschuh
2026-07-01  7:49   ` Philippe Mathieu-Daudé
2026-06-30  7:38 ` [PATCH v2 6/9] powerpc/vdso: " Thomas Weißschuh
2026-06-30  7:38 ` [PATCH v2 7/9] MIPS: VDSO: " Thomas Weißschuh
2026-06-30  7:38 ` [PATCH v2 8/9] sparc: vdso: " Thomas Weißschuh
2026-07-01  7:50   ` Philippe Mathieu-Daudé
2026-06-30  7:38 ` [PATCH v2 9/9] vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions Thomas Weißschuh
2026-07-01  7:51   ` Philippe Mathieu-Daudé
2026-06-30 13:16 ` [PATCH v2 0/9] vDSO: Respect COMPAT_32BIT_TIME 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=a512dc5f-0734-4bd0-838c-61c8820e5f6d@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andreas@gaisler.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chleroy@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=jstultz@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=sboyd@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    --cc=x86@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