Skip to content

vDSO: Respect COMPAT_32BIT_TIME

Thomas Weißschuh linux-api linux-arm-kernel linux-mips linuxppc-dev lkml sparclinux 3 versions – Applied

Status from this message: The following commit has been merged into the timers/vdso branch of tip:

Get series with b4
b4 am [email protected] change-id 20260113-vdso-compat_32bit_time-e808763e976a

Versions newest first

  1. v3 Latest9 patches 0 repliesApplied
  2. v29 patches 9 repliesSuperseded
  3. v17 patches 24 repliesSuperseded

Changes in v3 from the cover letter

- 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/[email protected]

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/9time: Respect COMPAT_32BIT_TIME for old time type functionskernel/sys_ni.c kernel/time/time.c+24 -40 replies
2/9vdso/gettimeofday: Validate system call existence for time() and gettimeofday()lib/vdso/gettimeofday.c+10 -00 replies
3/9x86/vdso: Respect COMPAT_32BIT_TIMEarch/x86/entry/vdso/common/vclock_gettime.c arch/x86/entry/vdso/vdso32/vdso32.lds.S+14 -80 replies
4/9arm64: vdso32: Respect COMPAT_32BIT_TIMEarch/arm64/kernel/vdso32/vdso.lds.S arch/arm64/kernel/vdso32/vgettimeofday.c+10 -60 replies
5/9ARM: VDSO: Respect COMPAT_32BIT_TIMEarch/arm/vdso/vdso.lds.S arch/arm/vdso/vgettimeofday.c+10 -60 replies
6/9powerpc/vdso: Respect COMPAT_32BIT_TIMEarch/powerpc/kernel/vdso/gettimeofday.S arch/powerpc/kernel/vdso/vdso32.lds.S arch/powerpc/kernel/vdso/vgettimeofday.c+23 -90 replies
7/9MIPS: VDSO: Respect COMPAT_32BIT_TIMEarch/mips/vdso/vdso.lds.S arch/mips/vdso/vgettimeofday.c+5 -00 replies
8/9sparc: vdso: Respect COMPAT_32BIT_TIMEarch/sparc/vdso/vclock_gettime.c arch/sparc/vdso/vdso32/vdso32.lds.S+8 -20 replies
9/9vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactionslib/vdso/gettimeofday.c+10 -00 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchArnd BergmannPhilippe Mathieu-Daudé
1/9R-b
2/9R-b R-b
3/9R-b
4/9R-b R-b
5/9R-b R-b
6/9R-b
7/9R-b
8/9R-b R-b
9/9R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/9] vDSO: Respect COMPAT_32BIT_TIME

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.

---
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/[email protected]

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/[email protected]

To: Andy Lutomirski <[email protected]>
To: Thomas Gleixner <[email protected]>
To: Ingo Molnar <[email protected]>
To: Borislav Petkov <[email protected]>
To: Dave Hansen <[email protected]>
To: [email protected]
To: H. Peter Anvin <[email protected]>
To: Russell King <[email protected]>
To: Catalin Marinas <[email protected]>
To: Will Deacon <[email protected]>
To: Madhavan Srinivasan <[email protected]>
To: Michael Ellerman <[email protected]>
To: Nicholas Piggin <[email protected]>
To: Christophe Leroy (CS GROUP) <[email protected]>
To: Thomas Bogendoerfer <[email protected]>
To: Vincenzo Frascino <[email protected]>
To: John Stultz <[email protected]>
To: Stephen Boyd <[email protected]>
To: "David S. Miller" <[email protected]>
To: Andreas Larsson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Arnd Bergmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Philippe Mathieu-Daudé <[email protected]>

---
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,

Signature · 1 line
Thomas Weißschuh (Schneider Electric) <[email protected]>