This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86: Remove vsyscall usage


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]