[PATCH] x86: Remove vsyscall usage

Siddhesh Poyarekar siddhesh@redhat.com
Fri Jun 19 20:17:00 GMT 2015


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



More information about the Libc-alpha mailing list