From 9464e1ef97fc5d233c65bf1256b18ab223d8ffbf Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Mon, 7 Sep 2020 20:05:18 +0000 Subject: [PATCH] Fix vdso compat32 timekeeping on !=x86. Since x86 is the only 32-bit arch that has a 32-bit time_t, adjust the private bintime32 struct in vdso to only use a 32 bit sec on amd64. This matches the existing behavior in the compat code. Noticed while implementing vdso timekeeping on powerpc. This should also theoretically fix vdso timekeeping for arm binaries on aarch64. See tools attached to https://reviews.freebsd.org/D26347 for testing. Reviewed by: kib (in irc) Sponsored by: Tag1 Consulting, Inc. --- sys/sys/vdso.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/sys/vdso.h b/sys/sys/vdso.h index b645e5356c84..3ab81b3eb900 100644 --- a/sys/sys/vdso.h +++ b/sys/sys/vdso.h @@ -102,8 +102,16 @@ struct vdso_sv_tk *alloc_sv_tk(void); #define VDSO_TH_NUM 4 #ifdef COMPAT_FREEBSD32 + +/* + * i386 is the only arch with a 32 bit time_t. + */ struct bintime32 { +#if defined(__amd64__) uint32_t sec; +#else + uint64_t sec; +#endif uint32_t frac[2]; };