This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86: Remove vsyscall usage
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 20 Jun 2015 00:45:32 +0530
- Subject: Re: [PATCH] x86: Remove vsyscall usage
- Authentication-results: sourceware.org; auth=none
- References: <553963C1 dot 2080600 at linaro dot org>
On Thu, Apr 23, 2015 at 06:27:29PM -0300, Adhemerval Zanella wrote:
> This patch removes the vsyscall usage for x86_64 port. As indicated
> by kernel code comments [1], vsyscalls are a legacy ABI and its concept
> is problematic:
>
> - It interferes with ASLR.
> - It's awkward to write code that lives in kernel addresses but is
> callable by userspace at fixed addresses.
> - The whole concept is impossible for 32-bit compat userspace.
> - UML cannot easily virtualize a vsyscall.
>
> The VDSO is a better approach for such functionality. Tested on i686,
> x86_64, and x32.
>
> [1] arch/x86/kernel/vsyscall_64.c
>
> --
>
> * sysdeps/unix/sysv/linux/i386/gettimeofday.c
> (__gettimeofday_syscall): Remove.
> * sysdeps/unix/sysv/linux/i386/time.c (__time_syscall): Remove.
> * sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday_syscall):
> Add function.
> (gettimeofday_ifunc): Use __gettimeofday_syscall as fallback mechanism
> if vDSO is not present.
> * sysdeps/unix/sysv/linux/x86/time.c (__time_syscall): Add function.
> (time_ifunc): Use __time_syscall as fallback mechanism if vDSO is not
> present.
> * sysdeps/unix/sysv/linux/x86_64/gettimeofday.c: Remove file.
> * sysdeps/unix/sysv/linux/x86_64/time.c: Likewise.
>
Looks good to me.
Siddhesh