• Thomas Gleixner's avatar
    x86: fix vsyscall wreckage · ce28b986
    Thomas Gleixner authored
    based on a report from Arne Georg Gleditsch about user-space apps
    misbehaving after toggling /proc/sys/kernel/vsyscall64, a review
    of the code revealed that the "NOP patching" done there is
    fundamentally unsafe for a number of reasons:
    
    1) the patching code runs without synchronizing other CPUs
    
    2) it inserts NOPs even if there is no clock source which provides vread
    
    3) when the clock source changes to one without vread we run in
       exactly the same problem as in #2
    
    4) if nobody toggles the proc entry from 1 to 0 and to 1 again, then
       the syscall is not patched out
    
    as a result it is possible to break user-space via this patching.
    The only safe thing for now is to remove the patching.
    
    This code was broken since v2.6.21.
    Reported-by: default avatarArne Georg Gleditsch <arne.gleditsch@dolphinics.no>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    ce28b986
vsyscall_64.c 8.25 KB