From: "tip-bot2 for Thomas Weißschuh" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: thomas.weissschuh@linutronix.de,
Thomas Gleixner <tglx@kernel.org>,
philmd@oss.qualcomm.com, Arnd Bergmann <arnd@arndb.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/vdso] vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions
Date: Tue, 07 Jul 2026 21:54:37 -0000 [thread overview]
Message-ID: <178346127750.744054.10293702070070173472.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260702-vdso-compat_32bit_time-v3-9-db9f36d8d432@linutronix.de>
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 369cecd238ac8317cccd27cf2452a8a6b6da1581
Gitweb: https://git.kernel.org/tip/369cecd238ac8317cccd27cf2452a8a6b6da1581
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Thu, 02 Jul 2026 10:21:33 +02:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 07 Jul 2026 23:52:54 +02:00
vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions
If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not
provide any 32-bit time related functionality.
Add some build-time validations to make sure the architecture-specific
glue satisfies this requirement.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260702-vdso-compat_32bit_time-v3-9-db9f36d8d432@linutronix.de
---
lib/vdso/gettimeofday.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index b8c1fc8..f7a591a 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -25,6 +25,8 @@
*/
#include <asm/vdso/gettimeofday.h>
+#include <linux/build_bug.h>
+
/* Bring in default accessors */
#include <vdso/vsyscall.h>
@@ -325,6 +327,8 @@ __cvdso_clock_gettime32_data(const struct vdso_time_data *vd, clockid_t clock,
struct __kernel_timespec ts;
bool ok;
+ BUILD_BUG_ON(!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME));
+
ok = __cvdso_clock_gettime_common(vd, clock, &ts);
if (unlikely(!ok))
@@ -354,6 +358,8 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *vd,
BUILD_BUG();
#endif
+ BUILD_BUG_ON(sizeof(tv->tv_sec) != 8 && !IS_ENABLED(CONFIG_COMPAT_32BIT_TIME));
+
if (likely(tv != NULL)) {
struct __kernel_timespec ts;
@@ -392,6 +398,8 @@ __cvdso_time_data(const struct vdso_time_data *vd, __kernel_old_time_t *time)
BUILD_BUG();
#endif
+ BUILD_BUG_ON(sizeof(*time) != 8 && !IS_ENABLED(CONFIG_COMPAT_32BIT_TIME));
+
if (vdso_is_timens_clock(vc)) {
vd = vdso_timens_data(vd);
vc = vd->clock_data;
@@ -481,6 +489,8 @@ __cvdso_clock_getres_time32_data(const struct vdso_time_data *vd, clockid_t cloc
struct __kernel_timespec ts;
bool ok;
+ BUILD_BUG_ON(!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME));
+
ok = __cvdso_clock_getres_common(vd, clock, &ts);
if (unlikely(!ok))
prev parent reply other threads:[~2026-07-07 21:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 8:21 [PATCH v3 0/9] vDSO: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 1/9] time: Respect COMPAT_32BIT_TIME for old time type functions Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 2/9] vdso/gettimeofday: Validate system call existence for time() and gettimeofday() Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 3/9] x86/vdso: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 4/9] arm64: vdso32: " Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 5/9] ARM: VDSO: " Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 6/9] powerpc/vdso: " Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 7/9] MIPS: VDSO: " Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 8/9] sparc: vdso: " Thomas Weißschuh
2026-07-07 21:54 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-07-02 8:21 ` [PATCH v3 9/9] vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions Thomas Weißschuh
2026-07-07 21:54 ` tip-bot2 for Thomas Weißschuh [this message]
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=178346127750.744054.10293702070070173472.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=philmd@oss.qualcomm.com \
--cc=tglx@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--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
all inboxes | Powered by JetHome®