Disabling vsyscalls on Linux

I am working on software that controls the system calls of other processes using ptrace (2). Unfortunately, most modern operating systems implement some kind of fast user-mode system calls called vsyscalls on Linux.

Is it possible to disable the use of vsyscysc / vDSO for one process or, if this is not possible, for the entire operating system?

+4
source share
2 answers

Try echo 0 > /proc/sys/kernel/vsyscall64

If you try to use gettimeofday calls and they do not appear, what time source is used by the system (pmtimer, acpi, tsc, hpet, etc.). I wonder if you dare to humor me while trying to force your timer to something older, like pmtimer. Perhaps one of the many gtod timer optimizations is that your ptrace calls can be avoided even if vsyscall is set to zero.

+5
source

For newer systems, echo 0 > /proc/sys/kernel/vsyscall64 may not work. In Ubuntu 16.04, vDSO can be disabled on a system scale by adding the kernel parameter vdso=0 to /etc/default/grub in the parameter: GRUB_CMDLINE_LINUX_DEFAULT .

IMPORTANT: the GRUB_CMDLINE_LINUX_DEFAULT parameter can be overwritten by other configuration files in /etc/default/grub.d/... , so double-check when to add a custom configuration.

0
source

Source: https://habr.com/ru/post/1383203/


All Articles