This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 01/12] linux: Fix vDSO macros build with time64 interfaces
* Florian Weimer:
> * Adhemerval Zanella:
>
>> diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
>> index 7e772e05ce..07d38466e2 100644
>> --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
>> +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
>> @@ -22,10 +22,6 @@
>>
>> #include <time.h>
>> #include <sysdep.h>
>> -
>> -#ifdef HAVE_GETTIMEOFDAY_VSYSCALL
>> -# define HAVE_VSYSCALL
>> -#endif
>> #include <sysdep-vdso.h>
>>
>> /* Used as a fallback in the ifunc resolver if VDSO is not available
>> @@ -36,7 +32,9 @@ __gettimeofday_vsyscall (struct timeval *restrict tv, void *restrict tz)
>> if (__glibc_unlikely (tz != 0))
>> memset (tz, 0, sizeof *tz);
>>
>> - return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
>> + if (INLINE_VSYSCALL (gettimeofday, 2, tv, tz) == 0)
>> + return 0;
>> + return INLINE_SYSCALL_CALL (gettimeofday, tv, tz);
>> }
>
> Given that this is the fallback function why do we try INLINE_VSYSCALL
> first?
As I mentioned in my other message, seccomp filters make INLINE_VSYSCALL
without fallback tricky because the vDSO could use a filtered system
call, while the direct syscall path would still succeed because it uses
a system call known to and approved by the seccomp filter.
Thanks,
Florian