[PATCH v3 0/9] vDSO: Respect COMPAT_32BIT_TIME
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Thu Jul 2 01:21:24 PDT 2026
If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not
provide any 32-bit time related functionality. This is the intended
effect of the kconfig option and also the fallback system calls would
also not be implemented.
I also tried to introduce some helpers to avoid much of the ifdeffery,
but due to the high variance in the architecture-specific glue code
these would need to handle, they ended up being worse than the current
proposal.
As a side-effect this will make the self-tests more reliable,
as there is now always a matching syscall available for each vDSO function.
clock_getres_time64() was only introduced in v6.19, so libc implementations
are likely not using it yet.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
Changes in v3:
- Pick up tags.
- Fix incorrect references gettimeofday() in per-arch commit messages.
- Test for CONFIG_COMPAT_32BIT_TIME over __WANT_OLD_TIME_TYPE_SYSCALL in compat_settimeofday()
- Link to v2: https://patch.msgid.link/20260630-vdso-compat_32bit_time-v2-0-520d194640dd@linutronix.de
Changes in v2:
- Also handle SPARC.
- Drop MIPS cleanup patches.
- Also handle gettimeofday().
- Add more static validations.
- Rebase on v7.2-rc1.
- Link to v1: https://lore.kernel.org/r/20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de
To: Andy Lutomirski <luto at kernel.org>
To: Thomas Gleixner <tglx at kernel.org>
To: Ingo Molnar <mingo at redhat.com>
To: Borislav Petkov <bp at alien8.de>
To: Dave Hansen <dave.hansen at linux.intel.com>
To: x86 at kernel.org
To: H. Peter Anvin <hpa at zytor.com>
To: Russell King <linux at armlinux.org.uk>
To: Catalin Marinas <catalin.marinas at arm.com>
To: Will Deacon <will at kernel.org>
To: Madhavan Srinivasan <maddy at linux.ibm.com>
To: Michael Ellerman <mpe at ellerman.id.au>
To: Nicholas Piggin <npiggin at gmail.com>
To: Christophe Leroy (CS GROUP) <chleroy at kernel.org>
To: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
To: Vincenzo Frascino <vincenzo.frascino at arm.com>
To: John Stultz <jstultz at google.com>
To: Stephen Boyd <sboyd at kernel.org>
To: "David S. Miller" <davem at davemloft.net>
To: Andreas Larsson <andreas at gaisler.com>
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-mips at vger.kernel.org
Cc: Arnd Bergmann <arnd at arndb.de>
Cc: linux-api at vger.kernel.org
Cc: sparclinux at vger.kernel.org
Cc: Philippe Mathieu-Daudé <philmd at oss.qualcomm.com>
---
Thomas Weißschuh (9):
time: Respect COMPAT_32BIT_TIME for old time type functions
vdso/gettimeofday: Validate system call existence for time() and gettimeofday()
x86/vdso: Respect COMPAT_32BIT_TIME
arm64: vdso32: Respect COMPAT_32BIT_TIME
ARM: VDSO: Respect COMPAT_32BIT_TIME
powerpc/vdso: Respect COMPAT_32BIT_TIME
MIPS: VDSO: Respect COMPAT_32BIT_TIME
sparc: vdso: Respect COMPAT_32BIT_TIME
vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions
arch/arm/vdso/vdso.lds.S | 2 ++
arch/arm/vdso/vgettimeofday.c | 14 ++++++++------
arch/arm64/kernel/vdso32/vdso.lds.S | 2 ++
arch/arm64/kernel/vdso32/vgettimeofday.c | 14 ++++++++------
arch/mips/vdso/vdso.lds.S | 2 ++
arch/mips/vdso/vgettimeofday.c | 3 +++
arch/powerpc/kernel/vdso/gettimeofday.S | 8 ++++++++
arch/powerpc/kernel/vdso/vdso32.lds.S | 8 +++++---
arch/powerpc/kernel/vdso/vgettimeofday.c | 16 ++++++++++------
arch/sparc/vdso/vclock_gettime.c | 4 ++++
arch/sparc/vdso/vdso32/vdso32.lds.S | 6 ++++--
arch/x86/entry/vdso/common/vclock_gettime.c | 20 ++++++++++++--------
arch/x86/entry/vdso/vdso32/vdso32.lds.S | 2 ++
kernel/sys_ni.c | 4 ++++
kernel/time/time.c | 24 ++++++++++++++++++++----
lib/vdso/gettimeofday.c | 20 ++++++++++++++++++++
16 files changed, 114 insertions(+), 35 deletions(-)
---
base-commit: e6da2429169af9b33f3629b69905d89bb5ee9e64
change-id: 20260113-vdso-compat_32bit_time-e808763e976a
Best regards,
--
Thomas Weißschuh (Schneider Electric) <thomas.weissschuh at linutronix.de>
More information about the linux-arm-kernel
mailing list