]> git.baikalelectronics.ru Git - kernel.git/commit
x86: fix vsyscall wreckage
authorThomas Gleixner <tglx@linutronix.de>
Wed, 20 Feb 2008 22:57:30 +0000 (23:57 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 26 Feb 2008 11:55:57 +0000 (12:55 +0100)
commit879950098970764a18227eafad07777fd27a7c1b
treeb13268d3301eb70074dd38d8e92c1fab0f955114
parent60c629c49dcd7bb8dc861ee21958b33088a89e77
x86: fix vsyscall wreckage

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: Arne Georg Gleditsch <arne.gleditsch@dolphinics.no>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/vsyscall_64.c