lkml.org 
[lkml]   [2014]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectPondering per-process vsyscall disablement
It would be nice to have a way for new programs to declare that they
don't need vsyscalls. What's the right way to do this? An ELF header
entry in the loader? An ELF header entry in the program? A new
arch_prctl?

As background, there's an old part of the x86_64 ABI that allows
programs to do gettimeofday, clock_gettime, and getcpu by calling to
fixed addresses of the form 0xffffffffff600n00 where n indicates which
of those three syscalls is being invoked. This is a security issue.

Since Linux 3.1, vsyscalls are emulated using NX and page faults. As
a result, vsyscalls no longer offer any performance advantage over
normal syscalls; in fact, they're much slower. As far as I know,
nothing newer than 2012 will attempt to use vsyscalls if a vdso is
present. (Sadly, a lot of things will still fall back to the vsyscall
page if there is no vdso, but that shouldn't matter, since there is
always a vdso.)

Despite the emulation, they could still be used as a weird form of ROP
gadget that lives at a fixed address. I'd like to offer a way for new
runtimes to indicate that they don't use vsyscalls so that the kernel
can selectively disable emulation and remove the fixed-address
executable code issue.


--Andy


\
 
 \ /
  Last update: 2014-05-23 02:01    [W:0.116 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site