Bug 13425 - Remove x86_64 Linux vsyscall page support
Summary: Remove x86_64 Linux vsyscall page support
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.14
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 22:26 UTC by Andy Lutomirski
Modified: 2014-06-27 11:34 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Lutomirski 2011-11-21 22:26:47 UTC
As of Linux 3.1, the vsyscall entry points (0xffffffffff600x00) are often slower and never faster than real syscalls.  They are also somewhat fragile in that they can confuse various binary tracing systems (e.g. the Chromium sandbox) and they cause some problems with UML.

It would be nice to support the vdso in static binaries, but, failing that, glibc should just stop using the vsyscall page.

(Note: for getcpu on older kernels without a real sys_getcpu syscall, the vsyscall page or vdso support might be mandatory.  But the syscall should IMO be preferred over the vsyscall entry.)

If this change is made, then vsyscall=none has a good chance of working :)

This is a continuation of bug 12813.
Comment 1 Andreas Jaeger 2011-11-22 08:17:27 UTC
Andy,did you check the changes done in the glibc head branch?

Like the following

2011-09-06  Ulrich Drepper  <drepper@gmail.com>

        * sysdeps/unix/sysv/linux/x86_64/clock_gettime.c: New file.
        * sysdeps/unix/sysv/linux/clock_gettime.c (SYSCALL_GETTIME): Allow
        already be defined.  Change to take two parameters and don't assign
        result to variable.  Adjust all users.
        Define INTERNAL_GETTIME if not already defined.
        Use INTERNAL_GETTIME instead of INTERNAL_VSYSCALL got clock_gettime
        call.
        * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Don't define
        HAVE_CLOCK_GETTIME_VSYSCALL.
        * sysdeps/unix/clock_gettime.c: Adjust use of SYSDEP_GETTIME_CPU.

        * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Don't use
        gettimeofday vsyscall, just use time.

What is missing from current head?
Comment 2 Andy Lutomirski 2011-11-22 15:41:25 UTC
That should do it.  I thought I'd checked the git history, but I obviously did a bad job.

Sorry for the noise.  I'll reopen if anything seems broken.